From 142defdd207274d439e0b8d78f0b98481d21f13a Mon Sep 17 00:00:00 2001 From: FoxxMD Date: Mon, 27 Jan 2025 14:57:15 +0000 Subject: [PATCH] docs: Put delimited artist example in expander --- docsite/docs/configuration/transforms.mdx | 54 ++++++++++++----------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/docsite/docs/configuration/transforms.mdx b/docsite/docs/configuration/transforms.mdx index 50720b08..67336461 100644 --- a/docsite/docs/configuration/transforms.mdx +++ b/docsite/docs/configuration/transforms.mdx @@ -482,38 +482,42 @@ Removes the phrase `(Album Version)` from the Title of a Play ### Extract primary Artist from delimited, multi-Artist string -When the Artist string is actually a multi-artist, delimited string, this search-and-replace will replace the string with just the first artist found. +
-Ex + When the Artist string is actually a multi-artist, delimited string, this search-and-replace will replace the string with just the first artist found. -``` -My Artist One / My Artist Two / Another Guy -My Artist One -``` + Ex -Artists are delimited with a spaced forward slash (`/`) in the regex below. Replace the contents of the `delim` capture group with the delimiter for your use case. Some more common scenarios: + ``` + My Artist One / My Artist Two / Another Guy + My Artist One + ``` -* `(?\\/)` No spaces between slash IE `My Artist One/My Artist Two/Another Guy` -* `(?\\s*\\\\\s*)` Backslash instead of forward slash IE `My Artist One \ My Artist Two \ Another Guy` -* `(?,)` Comma IE `My Artist One, My Artist Two, Another Guy` + Artists are delimited with a spaced forward slash (`/`) in the regex below. Replace the contents of the `delim` capture group with the delimiter for your use case. Some more common scenarios: -
+ * `(?\\/)` No spaces between slash IE `My Artist One/My Artist Two/Another Guy` + * `(?\\s*\\\\\s*)` Backslash instead of forward slash IE `My Artist One \ My Artist Two \ Another Guy` + * `(?,)` Comma IE `My Artist One, My Artist Two, Another Guy` - Example -```json5 title="config.json" -{ - "sourceDefaults": { - "playTransform": { - "preCompare": { - "artists": [ - { - "search": "(.*?)(?\\s*\\/\\s*)(.*$)", - "replace": "$1" - } - ] +
+ + Example + ```json5 title="config.json" + { + "sourceDefaults": { + "playTransform": { + "preCompare": { + "artists": [ + { + "search": "(.*?)(?\\s*\\/\\s*)(.*$)", + "replace": "$1" + } + ] + } } } } -} -``` + ``` +
+
\ No newline at end of file -- 2.51.2