IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> [X] %track% format string bug
PeroPano
post Oct 26 2011, 12:21
Post #1


Member


Group: Full Members
Posts: 6
Joined: 27-March 10
Member No.: 12154
Mp3tag Version: 2.45a



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!
Go to the top of the page
 
+Quote Post
DetlevD
post Oct 26 2011, 12:33
Post #2


Member


Group: Full Members
Posts: 5031
Joined: 26-May 06
From: Wuppertal, Germany, Planet Earth
Member No.: 3194
Mp3tag Version: 2.63



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


--------------------
* Beyond that, don't ask, when you don't know what to do with the answer. *
♥ home is where the heart is ♥
Go to the top of the page
 
+Quote Post
PeroPano
post Oct 26 2011, 13:25
Post #3


Member


Group: Full Members
Posts: 6
Joined: 27-March 10
Member No.: 12154
Mp3tag Version: 2.45a



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.
Go to the top of the page
 
+Quote Post
pone
post Oct 26 2011, 14:00
Post #4


Member


Group: Full Members
Posts: 1688
Joined: 15-March 09
From: Germany
Member No.: 9103
Mp3tag Version: 2.59b



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
Go to the top of the page
 
+Quote Post
DetlevD
post Oct 26 2011, 14:12
Post #5


Member


Group: Full Members
Posts: 5031
Joined: 26-May 06
From: Wuppertal, Germany, Planet Earth
Member No.: 3194
Mp3tag Version: 2.63



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

This post has been edited by DetlevD: Oct 26 2011, 14:24


--------------------
* Beyond that, don't ask, when you don't know what to do with the answer. *
♥ home is where the heart is ♥
Go to the top of the page
 
+Quote Post
PeroPano
post Oct 26 2011, 14:47
Post #6


Member


Group: Full Members
Posts: 6
Joined: 27-March 10
Member No.: 12154
Mp3tag Version: 2.45a



Thanks to all for the extensive help, it is very much appreciated!
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 1st November 2014 - 14:18