MMFrLife wrote:I like setting the track numbers for multi-disc releases (2+ discs) consecutively (ex.: if discs contain 10 tracks each, track order would run 09, 10, 11, 12, 13 .....).
However, I also like to keep a record of what the original track ordering is per disc at the end of the filename and title field, ex.: filename =
It's a Party Tonight [01_01].mp3. . That is where [01_01] = Disc 1, track 1.
I can already achieve this, but it takes multiple steps (some of which, I'm guessing, can't be avoided). Provided the track numbers are already set with a leading
zero, the disc # is then set (with leading zero for 1 - 9) and I hold off on the consecutive tracking and copy filename to the title until the end, is there a way to get at least the "[01_01]" part done in a single step?
You should have initially filed the original Disc # and Track #, then you could append that data to the end of e.g. Title and just then you could eventually modify Track # to have consecutive numbers for all multi-discs.
Preset:
Append [Disc #_Track #] to the <Into Field>...
Description: With leading zeroes to the single-digit Disc and Track numbers
Find what: $
Regular expression 1: checked
Replace with: IIf(Len("$_") > 0, " ", "") & "[" & Right("00" & oSongData.DiscNumberStr, 2) & "_" & Right("00" & oSongData.TrackOrderStr, 2) & "]"
VBScript expression: checked
The next part could be done in two ways: using the total number of tracks from each disc or using the maximal Track # from each disc (if you have discs with all tracks and if they all have correctly filled the Track # info, then these two presets would give the same result).
Preset:
Make consecutive Track # for multi-disc albums using total number of tracks from each disc
Description: If first disc has 8 tracks, Disc # = 2 and Track # = 1 -> Track # = 9
Find what: ^.*
Into: Track #
Regular expression 1: checked
Replace with: oSongData.TrackOrderStr + IIf(Int("0" & oSongData.DiscNumberStr) > 1, SQLQuery("SELECT Count(*) FROM Songs WHERE IDAlbum = " & oSongData.Album.ID & " AND DiscNumber < 0" & oSongData.DiscNumberStr & " GROUP BY IDAlbum"), 0)
VBScript expression: checked
If you want to use the next preset, it is very important that you sort tracks in the main tracklist by descending order of Disc # before selecting tracks and applying the preset:
Preset:
Make consecutive Track # for multi-disc albums using maximal Track # from each disc
Description: If Track # of the last track from the first disc is 8, Disc # = 2 and Track # = 1 -> Track # = 9
Find what: ^.*
Into: Track #
Regular expression 1: checked
Replace with: oSongData.TrackOrderStr + IIf(Int("0" & oSongData.DiscNumberStr) > 1, SQLQuery("SELECT Sum(MaxNo) FROM (SELECT Max(CAST(TrackNumber AS integer)) AS MaxNo FROM Songs WHERE IDAlbum = " & oSongData.Album.ID & " AND DiscNumber < 0" & oSongData.DiscNumberStr & " GROUP BY IDAlbum, DiscNumber)"), 0)
VBScript expression: checked
Finally, you could clear the Disc # using the existing "Clear <Into Field>..." preset or assign 1 to all tracks.