Skip to content

Commit

Permalink
docs: Put delimited artist example in expander
Browse files Browse the repository at this point in the history
  • Loading branch information
FoxxMD committed Jan 27, 2025
1 parent aad9f2b commit 142defd
Showing 1 changed file with 29 additions and 25 deletions.
54 changes: 29 additions & 25 deletions docsite/docs/configuration/transforms.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
<details>

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
```

* `(?<delim>\\/)` No spaces between slash IE `My Artist One/My Artist Two/Another Guy`
* `(?<delim>\\s*\\\\\s*)` Backslash instead of forward slash IE `My Artist One \ My Artist Two \ Another Guy`
* `(?<delim>,)` 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:

<details>
* `(?<delim>\\/)` No spaces between slash IE `My Artist One/My Artist Two/Another Guy`
* `(?<delim>\\s*\\\\\s*)` Backslash instead of forward slash IE `My Artist One \ My Artist Two \ Another Guy`
* `(?<delim>,)` Comma IE `My Artist One, My Artist Two, Another Guy`

<summary>Example</summary>
```json5 title="config.json"
{
"sourceDefaults": {
"playTransform": {
"preCompare": {
"artists": [
{
"search": "(.*?)(?<delim>\\s*\\/\\s*)(.*$)",
"replace": "$1"
}
]
<details>

<summary>Example</summary>
```json5 title="config.json"
{
"sourceDefaults": {
"playTransform": {
"preCompare": {
"artists": [
{
"search": "(.*?)(?<delim>\\s*\\/\\s*)(.*$)",
"replace": "$1"
}
]
}
}
}
}
}
```
```
</details>

</details>

0 comments on commit 142defd

Please sign in to comment.