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