Add catalogue number to foldername

Hello,

I was thinking if I add %catalognumber% to the default script:

$if2(%albumartist%,%artist%)/
$if(%albumartist%,%originalyear% - %album%/,)
$if($gt(%totaldiscs%,1),%discnumber%-,)$if($and(%albumartist%,%tracknumber%),$num(%tracknumber%,2) ,)$if(%_multiartist%,%artist% - ,)%title%

like this:

$if2(%albumartist%,%artist%)/
$if(%albumartist%,%originalyear% - %album%/,- %catalognumber%)
$if($gt(%totaldiscs%,1),%discnumber%-,)$if($and(%albumartist%,%tracknumber%),$num(%tracknumber%,2) ,)$if(%_multiartist%,%artist% - ,)%title%

It would add the catalogue number to the album name like this:
Artist\Year - Album - Cataloguenumber\Number - Title.filename

But it does nothing… What am I doing wrong?
Thanks!

You have it as the “False” part of the $if statement. Try something like:

$if2(%albumartist%,%artist%)/
$if(%albumartist%,%originalyear% - %album% - %catalognumber%/,)
$if($gt(%totaldiscs%,1),%discnumber%-,)$if($and(%albumartist%,%tracknumber%),$num(%tracknumber%,2) ,)$if(%_multiartist%,%artist% - ,)%title%
4 Likes

Thank you, that was it!

1 Like

Hello All, me again.
So, I’m using the script proposed by @rdswift but now I have a different problem.
If I have a 2-disc album, it creates two folders, one per each disc - which is annoying. I’d like to have it all in one folder, files named 1-01, 1-02, …, 2-01, etc…
Here’s an example of an album that’s causing my headache: https://musicbrainz.org/release/c8b95475-680c-4c11-a651-5a90fe8e2d15?tport=8000

Thanks for your help.

Without seeing your actual naming script I’m just guessing, but I think if you remove the part that’s writing the “(Disc 1)” and “(Disc 2)” parts to the file path it should do what you want.

Thanks @rdswift , it’s the actual code you wrote here: Add catalogue number to foldername - #2 by rdswift

It can’t be because the code you pointed to does not output “(Disc 1)” or “(Disc 2)” at all. I suspect that is something that you added to the script (likely in Line 2).

This is the script I use:

$if2(%albumartist%,%artist%)/
$if(%albumartist%,%originalyear% - %album% - %catalognumber%/,)
$if($gt(%totaldiscs%,1),%discnumber%-,)$if($and(%albumartist%,%tracknumber%),$num(%tracknumber%,2) ,)$if(%_multiartist%,%artist% - ,)%title%

But Picard seems to put the disc information in the tag info as well as they have popped up as Albumname (Disc 1) in my plex library as well, so maybe it’s not the script but a setting, my settings are the same as they always were… maybe Picard did update something?

e.g. this is the album information:

Album                                    : TG25∶ Diving Into The Unknown (Disc 1∶ Singles)

So it must be something how Picard started to insert the disc information into the tags, it definitely didn’t do this before the last version

Picard does not modify the tags on its own. Do you perhaps have a tagging script (not your file naming script) enabled that might be adding the disc numbers to the album tag? Or possibly a plugin that is modifying the album tag?

Also, are you renaming from the cluster pane or are you matching your files to a release in the album pane before saving?

1 Like

That’s striked an idea, let me check…

Bingo:
Plugin: Classic Disc Numbers
“Moves disc numbers and subtitles from the separate tags to album titles.”

1 Like

Thanks @rdswift for the idea, I think that was it.

1 Like

If you still wanted to have that information in the tags but not in the directory structure, you could get rid of the plugin and have a tagging script like:

$if(%_album%,,
    $set(_album,%album%)
    $if(%subtitle%,$set(album,%album% - %subtitle%))
    $if($gt(%totaldiscs%,1),$set(album,%album% \(Disc %discnumber%\)))
)

and modify your file naming script to use %_album% instead of %album% like:

$if2(%albumartist%,%artist%)/
$if(%albumartist%,%originalyear% - %_album% - %catalognumber%/,)
$if($gt(%totaldiscs%,1),%discnumber%-,)$if($and(%albumartist%,%tracknumber%),$num(%tracknumber%,2) ,)$if(%_multiartist%,%artist% - ,)%title%
1 Like