Disc/Total Discs and Track/Total Tracks

[ https://hydrogenaud.io/index.php/topic,98501.0.html ]


donstrack

26 December, 2012, 09:16:52 AM

I use MP3Tag and foobar2000 as a team. I wanted to have foobar2000 show the disc/total discs and track/total tracks. After much Googling and searching for scripts and script components in both the foobar2000 forums and the MP3Tag forums, I realized that I would have to manually set the actual total discs and actual total tracks.

In MP3Tag, in the Tag Panel, I created two new entries: Total Discs %TOTALDISCS%, and Total Tracks %TOTALTRACKS%.

Then I created a new Action called "Fix Total Discs Total Tracks.mta", with the following data:

[#0]
T=5
F=DISCNUMBER
1=$num(%DISCNUMBER%,1)/$num(%TOTALDISCS%,1)

[#1]
T=5
F=TRACK
1=$num(%TRACK%,1)/$num(%TOTALTRACKS%,1)

Usage:
In MP3Tag, select the files in a single folder/album; first one disc, then any additional discs. In the Tag Panel, based on information either from the discs or from other sources, set the total discs and total tracks for each disc selection. Then select the entire folder/album, and run the Action. Save the changes.


(NOTE: Using an Action script in MP3Tag fixes the problem of displaying total tracks and total discs, making the following changes in foobar2000 unnecessary.)

(Using an Action script in MP3tag allows the user to permentantly set the Track and Disc tags to the proper 15/19 and 1/2, without having to customize the display in foobar2000.)

In foobar2000, create two new columns:

-- Total Discs %TOTALDISCS%

-- Total Tracks %TOTALTRACKS%.

-- Change the Track column to [$num(%tracknumber%,1)/$num(%TOTALTRACKS%,1)]

$ifgreater(%totaltracks%,1),$num(%track%,1)/$num(%totaltracks%,1),$num(%track%,1))

-- Change the Disc column to [$num(%discnumber%,1)/$num(%TOTALDISCS%,1)]

$ifgreater(%totaldiscs%,1,$num(%disc%,1)/$num(%totaldiscs%,1),$num(%disc%,1))

The real question is, If there is only 1 disc, how do I stop foobar from displaying 1/1, but display 1/2, 2/2, etc. when there are multiple discs.

--DS

Last Edit: 26 December, 2012, 10:06:13 AM by donstrack


White_Shadow

Reply #1 – 26 December, 2012, 10:06:08 AM

To the first question: please check, if the total disc value in the file properities (ALT-ENTER) has only one number or if there are already two separate values equiv to 2;2. This may be related to a change in version 1.1.8. See changelog for further explanation: http://www.foobar2000.org/changelog

Second problem: type for example: $num(%track number%,0)


donstrack

Reply #2 – 26 December, 2012, 10:09:50 AM

Quote from: White_Shadow on 26 December, 2012, 10:06:08 AM

To the first question: please check, if the total disc value in the file properities (ALT-ENTER) has only one number or if there are already two separate values equiv to 2;2. This may be related to a change in version 1.1.8. See changelog for further explanation: http://www.foobar2000.org/changelog

Second problem: type for example: $num(%track number%,0)

Thank you. After another hour searching, I found the proper scripts to put in the Disc and Track columns, so I changed the OP.

I vaguely recall a forum post with a script to not display 1/1, but I can't find it in my browsing history.

--DS

Last Edit: 26 December, 2012, 10:10:20 AM by donstrack


White_Shadow

Reply #3 – 26 December, 2012, 10:15:24 AM

Ah! You've edited your first post... haven't seen int yet.

Try $ifgreater(%totaldiscs%,1,%disc%/%totaldiscs%,%disc%)

This should display "1", if there's only one disc and "1/2", if there are two of them. If you don't want to display the "1" either, then just leave the fourth argument empty.

[Edit:] Yey! I've forgotten the $num()-functions around the arguments:

$ifgreater(%totaldiscs%,1,$num(%disc%,1)/$num(%totaldiscs%,1),$num(%disc%,1))

Last Edit: 26 December, 2012, 10:23:59 AM by White_Shadow


donstrack

Reply #4 – 26 December, 2012, 10:54:49 AM

Quote from: White_Shadow on 26 December, 2012, 10:15:24 AM

$ifgreater(%totaldiscs%,1,$num(%disc%,1)/$num(%totaldiscs%,1),$num(%disc%,1))

Thank you. That did it.

--DS


TuNk77

Reply #5 – 27 December, 2012, 05:59:40 PM

I just wanted to share my string for multiple discs: ['('[Disc [%DISCNUMBER%][/%TOTALDISCS%]]')']


fuffi

Disc/Total Discs and Track/Total Tracks

Reply #6 – 21 March, 2015, 10:01:35 AM

for completion, I add my modyfied script, which additionally checks, if tag "Disc Number" is missing, which results in showing a leading slash (/1) in some cases, where only the tag "Total Discs" is filled and the tag "Disc Number" is left empty.

[[%DISCNUMBER%]$if(%DISCNUMBER%,[/%TOTALDISCS%],[%TOTALDISCS%])]

###