How to scrobble only primary artist to Last.fm #259
-
I use spotDL to download my Spotify playlists as local files and these seem to separate multiple artists with '/'. On Last.fm, the separation is also displayed with slashes, so I thought that I could use Scrobble Manipulation with regex to remove anything from artists that comes after the first slash (including it of course). No matter the combination, the regex doesn't find slashes. I then checked simpler regexes like "/word/i" and these do match, so they at least work in general. After that, I assumed that Multi-Scrobbler might 'split' the artists into singular artists to check the regex on, but contrary to that, there has been a fix specifically for scrobbling to Last.fm with just the primary artist (c648ad4). |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The commit you referenced for Last.fm is for when MS is scrobbling a track with multiple, well-formed artists already as proper list data IE {
"track": "My Track",
"artists": [
"Artist One",
"Artist Two",
"Artist Three"
],
"album": "My Album"
} In that case it will only send the first artist to Last.fm since last.fm doesn't support multiple artists (just one artist field in the scrobble request). The data you are using still has all artists in the same field so MS doesn't know it's multiple artists IE {
"track": "My Track",
"artists": [
"Artist One / Artist Two / Artist Three"
],
"album": "My Album"
} It's not as simple as saying "MS should always separate the artist field based on this character" because artist names are non-trivial and can have any number of symbols, separators, or exceptions to how they are formed. MS is not opinionated about how the artist names should look, for this exact reason. It assumes whatever the Source player is sending is correct for artist names so it doesn't step on anyone's toes.
This is feasible, though. And you were correct to try to use manipulations for this on the affected Source. I have added an example to the manipulation docs to show how this can be done (Extract primary Artist from delimited, multi-Artist string) and I've added a test case for it so you can be sure it is working. Using your config from #258 the whole thing would look like this {
"sources": [
{
"type": "vlc",
"enable": true,
"name": "MyVlc",
"data": {
"url": "localhost:8080",
"password": "123"
},
"options": {
"playTransform": {
"preCompare": [
{
"artists": [
{
"search": "(.*?)(?<delim>\\s*\\/\\s*)(.*$)",
"replace": "$1"
}
]
}
]
}
}
}
]
} This will detected multiple, whitespace-buffered forward slashes (
It uses Regular Expressions which support javascript's string Here is a regex example for it. Be aware that in JSON backslashes have to be escaped so what is normally On a related note though, MS does implement functionality to detect multiple artists from a single string, like you are dealing with, but it's only for Listenbrainz because MS can then verify if the detected values are correct against other LZ data. I will look into implementing this more generically as an option for all Sources so that if a user wants they can "aggressively" detect these patterns. It would likely cause false positives so it would be opt-in only but it seems like it would be helpful for scenarios like yours. |
Beta Was this translation helpful? Give feedback.
The commit you referenced for Last.fm is for when MS is scrobbling a track with multiple, well-formed artists already as proper list data IE
In that case it will only send the first artist to Last.fm since last.fm doesn't support multiple artists (just one artist field in the scrobble request).
The data you are using still has all artists in the same field so MS doesn't know it's multiple artists IE
It's not as simple as sa…