How to name comps and albums differently?


Here’s what I got.

I want to name albums like this;
$if2(%albumartist%,%artist%)/$if(%date%,$left([%date%,5)]) $if($ne(%albumartist%,),%album%$if(%catalognumber%, {%catalognumber%},)$if(%media%, {%media%},)$if(%_extension%,$upper( [%_extension%]))/)$if($gt(%totaldiscs%,1),%discnumber%-,)$if($ne(%albumartist%,),$num(%tracknumber%,2). ,)$if(%_multiartist%,%artist% - ,)%title%

result: albumartist/[year] album {cat #} {media} [ext]

And I want to name compilations like this;
$if2(%albumartist%,%artist%) - $if($ne(%albumartist%,),%album% $if(%date%,$left([%date%,5)])$if(%catalognumber%, {%catalognumber%},)$if(%media%, {%media%},)$if(%_extension%,$upper( [%_extension%]))/)$if($gt(%totaldiscs%,1),%discnumber%-,)$if($ne(%albumartist%,),$num(%tracknumber%,2). ,)$if(%_multiartist%,%artist% - ,)%title%

result: albumartist - album [year] {cat #} {media} [ext]

How can I tell the program to do both?


I guess this all depends on your definition of “compilation”:

  • If your definition is the same as iTunes’, then you can surround your two code segments with an $if() checking for %compilation%.
  • If your definition is the same as MusicBrainz’s definition, then you can see of “compilation” is in %~secondaryreleasetype%.
  • Or if by “compilation” you simply mean anything by Various Artists, then you can check whether %musicbrainz_albumartistid% is/equals “89ad4ac3-39f7-470e-963a-56509c546377”.
  • If none of these, you might need to do some iterating over track %artist%s to see if they/enough differ from %albumartist%.


Just wanted to point out that checking for %compilation% and comparing %musicbrainz_albumartistid% to “89ad4ac3-39f7-470e-963a-56509c546377” is actually the same :slight_smile: Picard internally sets the %compilation% variable based on whether the artist is the MusicBrainz Various Artist special artist or not.

What I do in my script is therefore simply something like:

$noop(Various Artist albums)
$if2(%albumartist%,%artist%)/%album%/%_discandtracknumber%%artist% - %title%,
$noop(Single Artist albums)