Skip to main content
Topic: Template Variable for TRACKTOTAL (Read 260 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Template Variable for TRACKTOTAL

It seems that whenever CUETools creates a flac file (cuetools or FLACCL), it includes a TRACKTOTAL tag in the generated .flac files.
Is there a CUE Paths Template variable that has access to the value used to set the TRACKTOTAL tag?
I would like to have the total number of tracks in an album as part of the album folder name.

BTW, I have tried %TRACKTOTAL%, %tracktotal% and %totaltracks%

(Windows emoji test, please ignore: 🔥 (I inserted this by tapping Windows-.). If someone with a Mac sees a fire emoji, please reply that you could.)

Re: Template Variable for TRACKTOTAL

Reply #1
I don't think the "total tracks" variable is available to the user, so you can't do it in CueRipper, and more importantly, none of my just over 700 flac images, (ripped with CueRipper 2.1.5 and 2.1.6) contain the total tracks information. Track rips, yes, but image rips, no. However, if yours do then this will work (I wrote the total tracks info to a flac image then tested):

You can do it in mp3Tag (a free tagging tool often recommended on this forum) using scripting. Go to the help pages and look at the Convert entry on the menu, and the Tag-Filenames section. The variable you need is %_total%

You need to create a new Action. Under the Action menu of mp3Tag, click Actions. Create a new Action using the top button on the right of the dialog box. Give the Action a name and click the top button again. Select "Format Value" as the type of Action. For the field, click the dropdown and select "_FILENAME".

For the format string, click the right arrow and select "Functions", then select "num(x,y)". The "x" is highlighted, click the right arrow again and select "Information fields", then "total". Replace the "y" with a "2" .

You can add any other bits of information you want to the filename using a combination of %variables% and text/characters., so your format string would be something like:


giving you something like "10cc-Sheet Music-tracks_10-1974.flac" when you run the action on an entry within mp3Tag.

Please test it first on some copied flac files, you don't want a tiny mistake to screw up your precious rips.

regards - plugs

having re-read your request, I see you want to include the tracks count in the file path. You can do that in the Action, for track rips you would need something like:


which would make the action write a copy of the file to "D:\!\10cc\Sheet Music-T10\The Wall Street Shuffle.flac" and you would need to manually delete the originals

Again, test it first - plugs


Re: Template Variable for TRACKTOTAL

Reply #2
Well, yeah, I can involve other tools, and I did. I have ~300 folders for ~300 CDs with 3200+ flac files from a major CD archiving binge.

I wrote a Windows PowerShell script 8) that calls metaflac.exe to read the TRACKTOTAL tag out of one flac file in each folder and then uses the value to update the folder name.

Now that I just do 1 or 2 CDs at a time, I just manually edit the folder name.

SimplePortal 1.0.0 RC1 © 2008-2019