I am giving my music library a makeover — particularly the renaming of the files in individual artist albums. The intended renaming are to comply with the two following formats, dependent on the number of discs in the album. Thus:
I wonder if it is somehow possible to apply both aforesaid actions simultaneously — rather than selectively — for an artist who have both single and multi-disc albums released, and with such a combination now open and facing renaming with Mp3tag?
If you have filled DISCNUMBER only for albums with more than 1 disc and left it empty for 1-disc-albums, then you could use: [%discnumber%-]%track%. %artist% - %title%
the part with %discnumber% will then only be written if there is data in DISCNUMBER.
Unfortunately, the disc number field is not empty across the board. In effect, some 1-disc albums are numbered (1) and some not (blank).
I suppose the disc number field can be cleared ahead of applying your solution, but that kind of defeats the efficiency aspect. Can the 1-disc album field possibly be cleared in one go along with your proposed renaming?
This depends on how exactly your current DISCNUMBER are filled.
Only 1 or 2 or 1/5 and 2/5 and so on?
If the right 1 character of your DISCNUMBER content is greater than 1 then the first part with $num(%discnumber%,1)- will be used.
If the right 1 character of your DISCNUMBER content is equal or less than 1, then the second part - after the comma (only with %track%. %artist% - %title%) - will be used.
Thank you, LyricsLover. The majority of the 1-disc albums, if numbered, are usually numbered 1. Does your format string in fact take care of a variety of numbers possibly located in this field?
Deleting the entry "1" in a 1-disc album is really not something you need to overthink for efficiency reasons—if the discnumber field actually indicates that there is only one disc. That would mean entries like "1/1" in the discnumber field. In that case, you simply process all the files, filter for "discnumber IS 1/1", and delete the field in all the files, which is done in no time depending on the number of files.
However, if it only shows "1", how is Mp3Tag supposed to know that there isn't also a second disc with the entry "2"? In my opinion, this can only be determined by individually reviewing the files, unless there are entries in other fields that allow for inferences.
On the other hand, if the DISCNUMBER field is empty you can't be sure whether it has simply been forgotten to be filled in or whether it should contain 1/1.
Filled with 1/1, you can be absolutely sure: there is only 1 disc for this album.
I ran a quick 1st test with your proposed format string. The disc-track number combination in the filenames of the multi-disc albums carries extra spaces around the dash, where no spaces are desirable. Example:
You can just use the already fixed Format string in the original suggestion
You control it with this part in the mentioned Format string: without spaces: $num(%discnumber%,1)-%track%. %artist% - %title% with spaces: $num(%discnumber%,1) - %track%. %artist% - %title%
... the disc number of the disc number(ed) 1 of multi-disc albums gets discarded in the filename. The remaining discs are OK.
I suppose this is what @poster referred to with this:
However, if it only shows "1", how is Mp3Tag supposed to know that there isn't also a second disc with the entry "2"? In my opinion, this can only be determined by individually reviewing the files, unless there are entries in other fields that allow for inferences.
An album consisting of more than one disc. Example:
Artist Name\Greatest Hits 40th Anniversary Edition\Disc 1
Artist Name\Greatest Hits 40th Anniversary Edition\Disc 2
Artist Name\Greatest Hits 40th Anniversary Edition\Disc 3
I want to evenly and consistently rename all tracks in harmony with my OP — whether their %discnumber% field is blank or numbered. I want to do it, if possible, without having to first edit the 1-disc albums that currently display "1" in the disc-number field, down to blank:
The format string provided by @ohrenkino works well, too. However, on those 1-disc albums where %discnumber% is numbered "1", it prefixes the (undesirable) disc number "1" to the filename. In order to alleviate that, it means that the %discnumber% has to be cleared everywhere it occurs, each time, before the tracks can be renamed.
I can see the issue. I was hoping for a quick-fix miracle despite that. Thank you for offering your expertise.
So any indication that there is a multidisc album can be found in the folder name?
Then it would be simple to either delete the undesirable "1"s or use the data from the folder name.
If there is no TOTALDISC value, or it is "1" then only the TRACK and TITLE are used in the file naming. Anything with a TOTALDISC greater than "1" adds the disc number and a dash before the rest of the track and title.
[Edit: My actual naming uses the ALBUMARTISTSORT, ALBUMSORT, and TITLESORT fields to keep everything aligned in my folder structure. I used the standard field references in my suggestion as many users do not add the sort fields in every case.]
Sadly, no. I originally handled multi-disc albums by creating subfolders within the album folder, for example named CD1, CD2, CD3, etc. Later, I moved away from using subfolders and instead listed all the renamed files from all three discs in a single folder, using an appropriate disc number as a prefix for each file.
At the moment, the only meaningful standard to work from is probably the %discnumber% field. However, as we have seen, that poses a problem inasmuch as that field can hold one of two values—one of which clashes with the value "1" used for the first disc of multi-disc albums.
You will not get around cleaning up the tag data first.
Otherwise there is no way to tell whether the "1" is a valid value or not.
It looks to me as though the intended unification of the file names does not work as it is only the messenger for the underlying "chaos".
You could limit the files that need investigation with a filter like: %discnumber% IS 1 AND NOT %_directory% HAS 1 AND NOT %discnumber% HAS /
and then see if the "1"s could be deleted