File naming and sorting

Greetings everyone. I am still working formulating a script to get my music files named and sorted. Unfortunately i am pretty ignorant about the coding language and syntax used here, so if any of you know how to help me I would greatly appreciate it. Here’s how I would like things arranged:

Music files sorted into albumartist folders, then album folders with release year, for example;
Led Zeppelin/1973 - Houses of the Holy

Music files named with track number - track name, with the disk number added to track number if the album has more than one disk, like so:
2-04 - Spinning Wheels

I don not want separate disk number folders created

Give this a try and see if it does what you want:

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

Thanks rdswift,

I tried your script but I’m still not getting the disk number added to the track number in the file names.

Are you not getting the disc number even with a multi-disc album? If so, that’s odd. We could take out the test so that they always appear. The script would be:

%albumartist%/$if2(%originalyear%,0000) - %album%/%discnumber%-$num(%tracknumber%,2) - %title%

Ok, this accomplishes the disc numbers, but now I notice the file extensions have been removed from the files.

Had the same problem
Got help
maybe its also good for You

I’ve never seen that before. Perhaps you should enter a ticket on Jira explaining the problem. Be sure to include as much information as you can, including what operating system and what version of Picard you’re using, a list of installed and enabled plugins, and whether there is anything showing up in the error/debug log.

1 Like

So I reinstalled the most recent software, and I’ve got your second script working. Now I’d still like to accomplish what your first script was intended for. I don’t understand why it doesn’t work properly. Any ideas?

Perhaps a plugin or a script running before the naming script is clearing or removing the totaldiscs tag.


maybe you can use my skript for renaiming

$left($if2(%albumartistsort%, %artistsort%),40)/ 
$left(%album%,65)$if(%date%, - $left(%date%,4))/ 
%tracknumber% $left(%title%,40) - $left($if2(%artistsort%, %artist%),40) 
$upper($firstalphachar($if2(%albumartistsort%, %artistsort%),#)) 
/$left($if2(%albumartistsort%, %artistsort%),65)/ 
$left(%album%,65)$if(%date%, - $left(%date%,4))/ 
%tracknumber% $left(%title%,40) - $left($if2(%artistsort%, %artist%),40) 

and ad a skript under skripting which unsets album tracknumber etc. for non Album Tracks