Folder naming from first entry in [artists] multitag?

Tags: #<Tag:0x00007f0509b7bc80> #<Tag:0x00007f0509b7bb40> #<Tag:0x00007f0509b7b9b0>


So I’ve noticed that the default file naming script in Picard is this:

$if2(%albumartist%,%artist%)/$if($ne(%albumartist%,),%album%/)$if($gt(%totaldiscs%,1),%discnumber%-,)$if($ne(%albumartist%,),$num(%tracknumber%,2) ,)$if(%_multiartist%,%artist% - ,)%title%

Which works great in most instances for albums. However if I add non-album tracks that also have “feat” artist credits, they get their own folder, like this:

\PrinceWhateverer feat. CG Scrambles & ShadyVox\track.mp3
\PrinceWhateverer feat. Dreamchan\track.mp3
\PrinceWhateverer, Poni1Kenobi & Turquoise Splash\track.mp3

Is there any simple way to adjust the naming script so it pulls the first artist name from the delimited [artists] multitag if [albumartist] is missing? For reference, the tag looks like this for the last track above:

Artists: PrinceWhateverer / Poni1Kenobi / Turquoise Splash

On a related note, does anyone know what ever happened to this bug report / pull request to have a [primaryartist] variable? That would be perfect for what I need.


I just solved this today!

The easiest two solutions would be to use either the Feat. Artists in Titles or Feat. Artists Removed plugins found here.

I however prefer them in the artist tag. What I have done is use this string:

$left($rreplace($if2(%albumartistsort%,%albumartist%,%artistsort%,%artist%),; [^\)]+,), 60)

The if2 will use the album artist (if it exists) before using artist. Typically the album artist will not include the featured artist.

If you are having trouble fitting that string into your script here is mine:

$if($eq(%albumartist%,Various Artists),
        [Various Artists],
$left($rreplace($if2(%albumartistsort%,%albumartist%,%artistsort%,%artist%),; [^\)]+,), 60))
$if(%date%,[$left(%date%,4)] )$left($replace(%album%,/,), 70)
$if($gt(%totaldiscs%,1),$if(%discnumber%, \(Disc %discnumber%\),),)
$num(%tracknumber%,2). $left(%title%,120),[:?"_]+,),  , )

This script will give you an output of:
\B\Beatles, The\[1965] Help!\07. Ticket to Ride.mp3 \[Various Artists]\[2005] Coup d'État, Volume 1 Ku De Ta Prologue\(Disc 2)\05. I've Got to Learn the Mambo.mp3

Hope this helps!

Regex help in scripting