Skip to content

Commit

Permalink
docs: Add primary artist extraction examples for scrobble modification
Browse files Browse the repository at this point in the history
  • Loading branch information
FoxxMD committed Jan 27, 2025
1 parent 8e92407 commit aad9f2b
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions docsite/docs/configuration/transforms.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -479,3 +479,41 @@ Removes the phrase `(Album Version)` from the Title of a Play
}
```
</details>

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

```
My Artist One / My Artist Two / Another Guy
My Artist One
```

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:

* `(?<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`

<details>

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

0 comments on commit aad9f2b

Please sign in to comment.