Sorting music folders into Year/Month/Artist/Album/etc. - Is this possible?

I’m trying to figure out how to get my music sorted into folders more productively, but I’m not a coder and can’t wrap my mind around the Python Script and how to make it work for me.

I was able to get the formatting for how to have MusicBrainz pull and sort into year folder, but now I’m curious about how to have it sort based on the metadata and the month folders associated with the release dates. Is this possible?

You might want to look at the tutorial for Writing a File Naming Script.

The year is usually extracted from %date% using a script like $if(%date%,$left(%date%,4)) to use the first 4 characters of the date (which usually is in the format “YYYY-MM-DD”). For the month it is a bit more tricky, but something like this should do: $substr(%date%,5,7). This will be empty, if the date is not long enough (e.g. only “2020”).

So for the complete folder structure of Year/Month/Artist/Album I’d use a script like this:


Picard file naming scripts are NOT Python - they are much simpler.

You only need to code a Python plugin if you are trying to do something unusual and so difficult that it is impossible using Picard scripts.

1 Like