"Feat. Artists in Titles" and "Soundtrack" port for Picard 3.x planned?

I updated to the new Picard version without checking beforehand and these plugins i used regularly are gone, so my library is now inconsistently.

“Feat. Artists in Titles” (moves featured artists from the artist tag into the track/album title) and “Soundtrack” (sets albumartist to “Soundtrack” if the release type is a soundtrack) are not available anymore in the plugin registry.

So, as mentioned in Picard 3.0 released – MetaBrainz Blog , i’m opening a thread to ask if there are plans to port these or if someone is working already on it.

2 Likes

I think this can be handled with a tagger script like:

$if($find(%_secondaryreleasetype%,soundtrack),$set(albumartist,Soundtrack))
2 Likes

Using the “Additional Artists Variables” plugin, I was able to make a small script which sets the primary artist cred to the Artist value, and then appends the feat. with the extra artists to the end of the title:

$if(%_artists_track_additional_cred%,
  $set(artist,%_artists_track_primary_cred%)
  $set(title,%title% \(feat. %_artists_track_additional_cred%\))
)

Yes, that’s it basically. You might want to check if %_artists_track_all_cred% actually contains “feat”, though. Otherwise you could end up with something like “Harvest (feat. Nash & Young)” by “Crosby” or “Ring Ring (feat. Björn, Benny, Annifrid)” by “Agnetha”.

yeah, that ended up happening, not sure how i can fix that cleanly

The longer you think about it, the more complicated it becomes. :grin:

I suggested searching the full artist credit for “feat”, but that would give false positives for artists like “Little Feat” or “Horse Feathers”. I also discovered – to my surprise – that there are lots of artists whose names have the form “X feat. Y”, although they are just a normal band or even only a single person. Just separating “primary” and “additional” artists from the plugin doesn’t work either, as we both found out.

The only way seems to be to loop over all the join phrases until we find “featuring”, and store everything to the left as main artist and everything to the right as featured artist. Although I myself don’t want featured artists in the song title, I took this as a little scripting exercise:

$set(_pattern,feat|ft|with)

$unset(_artists_main)
$unset(_artists_extra)
$set(_a,_artists_main)

$foreach(%_artists_track_all_join_phrases%,
  $set(%_a%,$get(%_a%)$getmulti(%_artists_track_all_cred_multi%,$sub(%_loop_count%,1)))
  $if($rsearch(%_loop_value%,%_pattern%),$set(_a,_artists_extra))
  $if($ne(%_loop_value%,\u200B),$set(%_a%,$get(%_a%)$rreplace(%_loop_value%,\(^[^\,;]\), \\1) ))
  )
$if(%_artists_extra%,
  $set(artist,%_artists_main%)
  $set(title,%title% \($trim(%_artists_extra%)\))
  )

Note that this requires the Additional Artists Variables plugin.

The first line defines how we recognise featured artists. The regex pattern matches things like “featuring”, “feat”, “ft” (both with or without dot), and also “with”. You can add more keywords separated by vertical bars if you like.

Then we start alternately appending credits and join phrases to the _artists_main variable, until we hit a joiner that matches our search pattern. In that case we flip the switch and append the rest to _artists_extra.

There are two possible pitfalls I had to work around. First, the plugin seems to strip leading and trailing whitespace from the join phrases. I would call that a bug, since we dont want things like “featuringTomandJerry”. So we have to add them back, but not in front of a comma or semicolon. That’s what the $rreplace() is for.

Second, an empty joiner is not really empty, but is passed as a “zero width space” (Unicode U+200B). While this might make sense in a word processing application, I’m not sure if all MP3 players can handle that correctly, so to be on the safe side we skip over that. Without these two issues the last line in the loop would simply be $set(%_a%,$get(%_a%)%_loop_value%).

I think that should handle most cases, although there will still be some that must be adjusted manually.

Please enter a bug report / feature request at Issues · rdswift/picard-plugin-additional-artists-variables · GitHub so this doesn’t get forgotten and I’ll look into it. Thanks.

EDIT: I just had a quick look at the code, and I don’t think I’m actually stripping the leading and trailing spaces from the join phrases. When I have a bit more time, I’ll check using the View Script Variables plugin to confirm. On the other hand, I am replacing an empty join phrase string with U+200B. I think I originally did this because there was an issue with empty strings being removed from multi-value variables, so I needed to have somthing there to ensure that there was the same number of join phrases as there were artists. If the issue of empty strings being dropped is no longer present, then I can add an option setting to allow the user to decide whether to leave them as empty strings or as a U+200B character.