How to create folders based on Album Name

I'm generating the folder names based on the Album title and Year, in the following Format Value field:

$regexp(%year%,^.*(\d{4}).+?$,$1) - %album%\%_FILENAME%

Which gives me: 2019 - Album Name/01 File.mp3

But I wanted to check, if the album title field contains the string " - EP", then it would perform this action:

EPs/$regexp(%year%,^.*(\d{4}).+?$,$1) - %album%\%_FILENAME%

And if the folder contains the string " - Single", then it would perform:

Singles/$regexp(%year%,^.*(\d{4}).+?$,$1) - %album%\%_FILENAME%

And if the album title doesn't have any of those, then it would be an Album:

Albums/$regexp(%year%,^.*(\d{4}).+?$,$1) - %album%\%_FILENAME%

It would work because I use the iTunes API as source for the tags, and it is an old standard in the iTunes Store. I think it would require 3 different actions, and would output empty if the string doesn't match the album name, just to jump to the next action, but I don't know how to do it. Thanks!

You could fill a special, user-defined field with the release type e.g. with an action of the type "Guess value"
Source: %album%
Target: %album% - %my_type%
This should fill MY_TYPE with "EP" or "Single".
As an addidtion add an action of the type "Format value" for MY_TYPE:
Format string: $if2(%my_type%,Album)
Now you have the field MY_TYPE and you can use it to create a path.

Just out of curiostiy: $regexp(%year%,^.*(\d{4}).+?$,$1) I assume is supposed to cut YEAR to just 4 digits?
$num(%year%,1) would do the same. Looks less complicated to me.

1 Like

Can't I just check if the album name contains the string " - EP" somewhere in the album field, and if it does, then I run

EPs/$num(%year%,1) - %album%\%_FILENAME%

You could use
$ifgreater($strstr(%album%,'- EP'),1,EPs\$num(%year%,1) - %album%\%_FILENAME%,%_directory%)
You would have to adapt that for the other cases.
It would be interesting how you deal with the absence of either of the special strings.
I still wonder what the befit of the added path length should be - the path is never evaluated by a decent player, so this information is redundant as it is already in the album name where you can search for it.
And if you use the album name as part of the path anyway, then you have the information about the EP (and others) twice.