GNOME Bugzilla – Bug 753739
zero-pad disc number in filename
Last modified: 2015-09-01 10:04:47 UTC
I just ripped a 15-CD set. In the Sound-Juicer UI I made a point of setting the disc number to zero-padded for the first 9 discs in the set, so that the filename would include a zero-padded disc number. I use the stock Number-Track Artist-Track Title (lowercase) filename template. With this template I get the disc number included in the filename, but it's not zero-padded, so it sorts discs 10-15 before disc 1 when I do an ls. This unfortunately also means that my music player of choice, MOC, sorts in that order as well. I have no problem with Sound-Juicer defaulting to single-digit disc numbers, but if I manually input the zero padding it would be really cool if it would respect that. Note that I'm on 3.4 because I'm on Ubuntu 12.04 for at least the next little while. I attempted to skim through bug reports & commit messages to see if this had already been addressed in a later release, but I didn't see anything. Thanks!
(In reply to Ross Grady from comment #0) Thanks for taking the time to report this issue, sorry for the slow reply. > I just ripped a 15-CD set. In the Sound-Juicer UI I made a point of setting > the disc number to zero-padded for the first 9 discs in the set, so that the > filename would include a zero-padded disc number. Sound Juicer treats the disc number you enter in the UI as an integer so it discards any leading zeros, I think this make sense in most cases - we should automatically format the disc number according to the total number of discs. I keep meaning to add a way of specifying the total number of discs in the UI for albums that are not in MusicBraniz. > I use the stock Number-Track Artist-Track Title (lowercase) filename > template. I'm going to change this template so that it looks at the total number of discs in the album and formats the disc number appropriately. This will work for albums in MusicBrainz but not others until I add a way to enter the total number of discs in the UI. > Note that I'm on 3.4 because I'm on Ubuntu 12.04 for at least the next > little while. I attempted to skim through bug reports & commit messages to > see if this had already been addressed in a later release, but I didn't see > anything. Thanks for checking, you're right it hasn't been addressed yet. The initial fix is simple, I'll try and push it this week.
Created attachment 309947 [details] [review] Zero pad disc number when needed Zero pad the disc number appropriately for the number of discs in the current album. This means that the tracks will sort properly when listed alphabetically by name. Currently there is no way to enter the number of discs in the current album in the UI so this only works for albums that have that information in MusicBrainz.
Attachment 309947 [details] pushed as 6bd1ea3 - Zero pad disc number when needed