Move only discs from multi-disc albums to their own subdirectory but don't move single-disc albums

Lately I've been sorting my library and now I got a little script that's almost 'universal' to me, the only problem it has is that it doesn't detect the first album of a multi-disc album because that was the solution I figured untill now: (album)\$if2($less(%discnumber%,2),Disc %discnumber%)\(track)

That almost does the trick but what happens is that it moves the discs numbered higher than 1 to a subdirectory but as it ignores those numbered with exactly "1" so even the first disc of a multi-disc album don't get it's own subdirectory. It is not really a deal breaker at this point but now I'm wondering if it's possible to also sort all discs of a multi-disc album to their own subdirectory but ignore those albums that are single discs.

Also I thought about using a kind of 2-step automated script but I don't think there's support for that:

  1. move all the tracks of an album to the album folder, name the tracks with their discnumber at the beginning
  2. then the second script deals with those tracks, reads that first number printed from the first script, moves them to their respective subfolder and renames the track file again to remove that markdown disc number.


How do you know that a track with "1" in DISCNUMBER is from a single disc album or from a multi-disc album?

I think the only way would be to look for sister folders already named and numbered 'CDx' or 'Disc x' higher than those tracks with discnumber 1 sitting in the album folder

I do not any way to find out the existence of other folders. MP3tag knows the data and some file system properties of the current file.

It would have been so much easier if the DISCNUMBER also featured the total number of discs like 1/2 or 1/3.

In general: any approach that requires to compare the contents of 2 files will fail as MP3tag cannot do that (with the only exception of the track numbering assistant which can also number discs.)

1 Like

oh ok, thank you very much

I just got an idea:
You can filter for files that do not have the "1" in DISCNUMBER with
NOT %discnumber% HAS 1

Then you rename the parentfolder so that it gets something like
Like that you can identify the paths which contain multi-disc albums.
Now you filter for files that have ___multi in the path but not "Disc"
And then you rename those files so that they also move to a "disc x" folder.

1 Like