File naming: test if folder exists and use series metadata for compilations

Tags: #<Tag:0x00007f29fe8a97e0> #<Tag:0x00007f29fe8a9420> #<Tag:0x00007f29fe8a91c8>


Hi all
I’m trying to improve my file naming template:

  1. I actually would like to have the single files either under the artist folder if the folder exists or under a generic folder for all the “orphan singles”, but I cannot figure out the way to test if a folder exists or not?

  2. Also, I’d like to use the series metadata from the Musicbrainz database for the compilations, but I don’t know what tag to use?
    An example would be the Buddha Bar series:
    I’d like to have a Buddha Bar folder under which all the volumes would be stored, so the logic would be something like: if album is part of a series, then move the disc under the series folder, if not move it under the album artist if any, otherwise to the “compilation name” folder

Any idea on these issues?
thanks for your help!


Picard currently does not get/understand MusicBrainz Series entities, so there’s no way currently to use Series data for file naming etc.

See this ticket:


ok thanks for the feedback!
is there any way to set this tag manually/create a tag in picard and then use it?

also, any idea on the “test if folder exists”?


A plugin could do this. Without a plugin it is not possible as Picard currently does not load the series data.

That’s currently not possible with Picard.


As @outsidecontext said, there’s not any way to do it automatically based on MusicBrainz series data. You can do it manually, though, and I actually do something similar in my library to handle multiple similar album artists.

It sounds like you know your way around scripting yourself, so I’ll gloss over the details on that end, but let me know if you want something explained further. First you need to figure out what tag you want to use; since I’m normally answering this for artists, I usually suggest %enclosingfolder% or %artistfolder%, but since this is an entirely new field without anything similar already existing, you can choose something like %series% or even %grouping%. The key is to get something that is not only easy to type and remember but also that won’t conflict with any existing tags you have on your files; %grouping% is a rare but official tag, so it would be really easy to type (G-R-tab), but the site says that the LastFMPlus plugin uses it and other programs might as well, so if you go that way, you’ll want to keep an eye on it to be sure it’s not been filled with anything you don’t want. Additionally, %grouping% is technically meant to apply to the track/recording level rather than the album, so you might not want to use it if you like everything to fit the standards. For those reasons, I’d recommend using %series% as it doesn’t have any official connection and is still simple, but go with what sounds best to you.

Within Picard, you right-click the bottom pane that displays all the data saved to the file, and select “Add new tag”. There’s a drop-down menu at the top of the dialog that pops up, but you can also type in whatever you want even if it’s not in the list. Unfortunately, Picard doesn’t remember those custom fields you enter – hence making sure whatever tag you chose is easy for you to type in whenever you wind up needing it, and why co-opting %grouping% is so tempting. Anyway, once you enter the field name, you can simply add the name of the series as normal.

Then, in your naming script, all you have to do is add $if(%series%,%series%/) wherever you want it, and you’re good!


thanks, manually adding a series tag allowed me to do what I wanted (and it is actually better since I can manually group albums!)

for the “test folder” function, it is actually a nice to have, I don’t have many cases where I’d need it, so no big deal…

thanks guys for your help