[Solved] Beets pattern to Picard taggerscript help

Hello folks. I have the following naming patterns in beets:

paths:
    albumtype:soundtrack: OST/[$original_year] - $album/[$album - ${disc_and_track}] - $artist - $title
    'series_name::.': Series/$series_name/[$original_year] - $album/[$album - $disc_and_track] - $artist - $title
    comp: Compilations/[$original_year] - $album/[$album - ${disc_and_track}] - $artist - $title
    singleton: Singles/$artist - $title
    default: Albums/$albumartist/[$original_year] - $album/$albumartist - [$album - $disc_and_track] %if{$diffartist,- $artist }- $title

I think this would require nested ‘if’ conditions, but I’m not sure in what order they ought to be. Could someone more adept at the taggerscript please help?

Thanks.

I don’t know beets configuration, but probably something like this for the different categories:

$if($in(%_secondaryreleasetype%,soundtrack),
OST/...,
$if($eq(%compilation%,1),
Compilations/...,
$if($eq(%album%,[non-album tracks]),
Singles/...,
$noop(Everything else)
Albums/...
)))

Not sure what “comp” and “singleton” really refer to. The above assumes comp is for Various Artist releases. If you also want to include everything with secondary type “compilation” you’d need a check like maybe $or($in(%_secondaryreleasetype%,compilation),$eq(%compilation%,1)).

The above assumes singleton refers to standalone-recordings. You have a few options here. By default Picard sets the album tag to “[non-album tracks]” for those (which can be customized in options). This is what the above checks. If you have scripted Picard to instead e.g. remove the album tag completely you could check for an empty album tag. Or maybe $not(%musicbrainz_albumid%).

Don’t know how the series_name thing gets handled by beets, but Picard has no support currently for MB series.

3 Likes

Thanks so much! This is exactly the nudge that I needed. I ended up with

$set(_year,$if2(%originaldate%,%date%))
$set(_year,$if($or(%originaldate%,%date%),[$left(%_year%,4)],))
$set(_discandtracknumber,$if($gt(%discnumber%,1),$num(%discnumber%,2).)$num(%tracknumber%,2))
$set(_diffartist,$if($ne(%albumartist%,%artist%),1))
$if($in(%_secondaryreleasetype%,soundtrack),
OST/%_year% - %album%/[%album% - %_discandtracknumber%] - %artist% - %title%,
$if($eq(%compilation%,1),
Compilations/%_year% - %album%/[%album% - %_discandtracknumber%] - %artist% - %title%,
$noop($if($not(%musicbrainz_albumid%),))
$if($eq(%album%,[non-album tracks]),
Singles/%artist% - %title%,
Albums/%albumartist%/%_year% - %album%/%albumartist% - [%album% - %_discandtracknumber%] $if($eq(%_diffartist%,1),- %artist% )- %title%
)))

It’s a pity that Picard doesn’t allow arbitrary tags (such as series names) to be used. Beets does, and that’s proved most helpful. For instance, the “Verve Jazz Masters” series has 60 CDs, most CDs with a single album artist, but with a few compilation albums as well. If Picard doesn’t allow using of arbitrary tags / series names, then I can’t arrange them all in a single directory.

Not sure what you mean, but you can use any tag you want. If you set a tag series_name and set this for all the files to “Verve Jazz Masters” you can then use %series_name% in your naming script.

2 Likes

I didn’t know that! Thanks, this is great, @outsidecontext. You’ve been super helpful. I’ll mark this topic “solved”.

2 Likes