Help - Search - Members - Calendar
Full Version: [X] %track% format string bug
Mp3tag Forums > Mp3tag - International > Bug Reports > No Bugs
PeroPano
Hi there!

There is an annoying bug in MP3Tag: Some MP3 files in the Track-Number tag have values like 1/21, 2/21, 3/21 etc. So now, when I make a Tag-Filename action (rename the MP3 files according to their tags) the %track% format string results to: 121, 221, 321 etc. But instead it should result to 01, 02, 03 etc. I.e., the %track% format string should consider only the number BEFORE the slash!

BTW, thank you to the authors for this very useful program!
DetlevD
QUOTE (PeroPano @ Oct 26 2011, 13:21) *
...Track-Number tag have values like 1/21, 2/21, 3/21 etc. ... should result to 01, 02, 03 etc. ...

In your format string ...
instead of %TRACK%
use
$num(%TRACK%,2)

DD.20111026.1333.CEST
PeroPano
QUOTE (DetlevD @ Oct 26 2011, 13:33) *
In your format string ...
instead of %TRACK%
use
$num(%TRACK%,2)

DD.20111026.1333.CEST


Hi Detlev, thank you for the hint, this works.

However, also without the $num function MP3Tag should consider only the characters before the slash. It does not make any sense at all to have the %TRACK% format string resolve to something like 321.
pone
ZITAT(PeroPano @ Oct 26 2011, 14:25) *
It does not make any sense at all to have the %TRACK% format string resolve to something like 321.


It does:

%track% = 3/21

/ is a invalid character for filenames in Windows. So Mp3tag does not write it and you get "321" in a filename.

Alternatives:

$validate(%track%,_) = 3_21
$replace(%track%,/,⁄) = 3⁄21
$num(%track%,1) = 3
$num(%track%,2) = 03
$num(%track%,3) = 003
$num(%track%,2) of $regexp(%track%,.+/,) = 03 of 21
DetlevD
QUOTE (PeroPano @ Oct 26 2011, 14:25) *
... MP3Tag should consider only the characters before the slash. It does not make any sense at all to have the %TRACK% format string resolve to something like 321.

There is already some sense implemented.

If there is the value given "3/21" in the tag-field TRACK, then Mp3tag uses this value, why not?
So you can copy or append or prepend or insert this value to some other tag-field or put it into a text file by a Mp3tag report file.

When using the value "3/21" to create a file name or folder name, Mp3tag automatically removes such characters, which are forbidden to use for names in the file system, so the value will be changed to "321".

In the given limits you can control the validating to your own needs by using the function
$validate(<format-string>,<replace-char>).
See Mp3tag manual.

See also ...
http://forums.mp3tag.de/index.php?showtopi...ost&p=38673

On the other hand you can provide the tag-field TRACK without the total tracks part.
Simply use two separate tag-fields TRACK=3 ... and ... TOTALTRACKS=21.

Use function $num(<number>,<digits>) to format the track number ...
$num(%TRACK%,2)

Use function $num(<number>,<digits>) to format the number of total tracks ...
$num(%TOTALTRACKS%,2)

If needed, then build a format string of both components ...
$num(%TRACK%,2)'-'$num(%TOTALTRACKS%,2)

DD.20111026.1523.CEST
PeroPano
Thanks to all for the extensive help, it is very much appreciated!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.