Skip to main content
Topic: How to calculate total amount of Discnumber ? (Read 236 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

How to calculate total amount of Discnumber ?

Hi,

when using masstagger scripts to guess the DISCNUMBER from foldernames, (say, CD1, CD2, ...)
I always wondered (and I tried so many failing approaches) if it is possible to automaticly fill in %TOTAL DISCNUMBER% with the highest %DISCNUMBER% found in the scripts.

It never worked for me, but I guess/hope, it is possible.

Is there a script guru out there, who can help and/or point me to something, I could use?

In my script, I presume, that the foldername contains at least a number, which I will use for the DISCNUMBER.
I strip all "useless" (like alphabetical characters)  information and only try to take the number in account.

Code: [Select]
Guess values from filename: %DISCNUMBER%\
Format %DISCNUMBER% using $lower(%DISCNUMBER%)
Format %DISCNUMBER% using $replace(%DISCNUMBER%,a,,b,,c,,d,,e,,f,,g,,h,,i,,j,,k,,l,,m,,n,,o,,p,,q,,r,,s,,t,,u,,v,,w,,x,,y,,z,,ä,,ö,,ü,,?,,ß,,!,,-,,'',,',',,'[',,']',,'(',,')',, ,,:,,.,,&,,/,,=,,",,´,)
Format %DISCNUMBER% using [$trim(%DISCNUMBER%)]
Format %DISCNUMBER% using $right(%DISCNUMBER%,1)

But how can I "remember" the highest number ?

Re: How to calculate total amount of Discnumber ?

Reply #1
Hey fuffi,

I've always wondered why there is no 'Auto Disc Number' on track Properties > Tools button to go with 'Auto Track Number'. The latter only appears when multiple tracks are selected; surely foobar could see when tracks from multiple folders containing "Disc 1, Disc 2" (etc) are selected, to only then offer the option - mapping to DISCNUMBER, with the highest numbered folder becoming the TOTALDISCS value. (Perhaps a request for the wish list?)

I'm not sure this is possible with scripts though. Masstagger scripts are run per-track, and typically the TOTALDISCS info is not in the %path% - no way to see info from other tracks or other folders(?). And I think variables ($puts) are only per-script, and not "remembered" - as you have probably found.

(I would not mind being wrong though ;) )

Cheers

Re: How to calculate total amount of Discnumber ?

Reply #2
I guess, there must be a way already, I just don't see it...

And I think variables ($puts) are only per-script, and not "remembered"
You can easily "store" variables into tags for further processing and later remove those temporary tags.

Say, you want to store %DISCNUMBER%, you can set it via Format value (Destination field name: TEMP and Formatting pattern: %DISCNUMBER%) or Guess value from filenames (Scheme: %TEMP%. %TEMP2%), etc.

I just don't know/manage, how to keep only the highest %DISCNUMBER% stored and set it then to %TOTAL DISCNUMBER%.
It maybe can be done with $ifgreater(A,B,C,D)...

 
SimplePortal 1.0.0 RC1 © 2008-2019