I Need some help with my Naming script

i just want to add this “-”

$if2(%albumartist%,%artist%)/

[$replace(%originaldate%,-,.)] %album%/

$if($gt(%totaldiscs%,1),Disc $num(%discnumber%,2),) $if2(%discsubtitle%,)/

$num(%tracknumber%,2). %title%

I am not an expert but it looks good except that:

  1. you will have discnumbers formatted as two digits with a leading zero;
  2. if there is no albumartist because e.g. it is non-album-track, there may be no album title either.
1 Like

How do you want it displayed if there is no title to the disc? Also, I assume that if there is only a single disc you don’t want to include the subdirectory at all.

If you just want to show “Disc 1” then try something like:

$if2(%albumartist%,%artist%)/
[$replace(%originaldate%,-,.)] %album%/
$if($gt(%totaldiscs%,1),Disc $num(%discnumber%,2)$if(%discsubtitle%, - %discsubtitle%)/,)
$num(%tracknumber%,2). %title%

If you want to display a default title such as “Disc 1 - Untitled” then try:

$if2(%albumartist%,%artist%)/
[$replace(%originaldate%,-,.)] %album%/
$if($gt(%totaldiscs%,1),Disc $num(%discnumber%,2) - $if2(%discsubtitle%,Untitled)/,)
$num(%tracknumber%,2). %title%

Note that this is just off the top of my head and I haven’t tested the code.

Also, if you haven’t already done so, you might want to check out the Tutorial for Writing a File Naming Script and the other information in the Picard User Guide.

3 Likes

Thank you very much it work amazing

1 Like