TRACK and DISNUMBER to TRACK+TRACKTOTAL and DISNUMBER+DISCTOTAL

I'd like to do this after I copy tags from mp3 files to FLAC files, because Vorbis comments don't use #/# format like ID3 tags.

So, for example:

MP3
%track%: 1/15
%discnumber%: 1/2

FLAC
%track%: 1
%tracktotal%:15
%discnumber%: 1
%disctotal%:2

I guess that first I need an action that formats %tracktotal% and %disctotal% from %track% and %discnumber% and then another that deletes the last part of %track% and %discnumber%

Or is there an action that would do the same thing as "Autonumbering Wizard"?

Here is something I have been using for quite some time and it works perfectly. Probably a cleaner method out there but it works and thats what matters :slight_smile: .

This deals with the total disks.

Begin Action Group Format 1#TOTALDISKS %Discnumber%

Action #1
Actiontype 5: Format value
Field: TOTALDISKS
Formatstring: %discnumber%

Action #2
Actiontype 4: Replace with regular expression
Field: TOTALDISKS
Regular expression: ^\d/(\d+)$
Replace matches with: $1
[_] Case sensitive comparison

End Action Group Format 1#TOTALDISKS %Discnumber% (2 Actions)

It fill the total disk to the track and vice versa.

Begin Action Group Format 1#TRACK %Track%%Totaltracks%

Action #1
Actiontype 4: Replace with regular expression
Field: TRACK
Regular expression: ^(\d)$
Replace matches with: 0$1
[_] Case sensitive comparison

Action #2
Actiontype 5: Format value
Field: TRACK
Formatstring: %track%/%totaltracks%

Action #3
Actiontype 4: Replace with regular expression
Field: TRACK
Regular expression: ^(\d+)/(\d+)/(\d+)$
Replace matches with: $1/$3
[_] Case sensitive comparison

Action #4
Actiontype 4: Replace with regular expression
Field: TRACK
Regular expression: /+$
Replace matches with:
[_] Case sensitive comparison

Action #5
Actiontype 5: Format value
Field: TOTALTRACKS
Formatstring: %track%

Action #6
Actiontype 4: Replace with regular expression
Field: TOTALTRACKS
Regular expression: ^\d+/
Replace matches with:
[_] Case sensitive comparison

Action #7
Actiontype 4: Replace with regular expression
Field: TRACK
Regular expression: ^/\d+
Replace matches with:
[_] Case sensitive comparison

Action #8
Actiontype 4: Replace with regular expression
Field: TOTALTRACKS
Regular expression: ^/
Replace matches with:
[_] Case sensitive comparison

End Action Group Format 1#TRACK %Track%%Totaltracks% (8 Actions)

Optional (Add leading zeros track + Totaltrack)

Begin Action Group Format 1#TRACK + TOTALTRACK Add Leading Zeros

Action #1
Actiontype 4: Replace with regular expression
Field: TRACK
Regular expression: ^(\d)(/\d+)$
Replace matches with: 0$1$2
[_] Case sensitive comparison

Action #2
Actiontype 4: Replace with regular expression
Field: TRACK
Regular expression: ^(\d{0,4})/(\d{1})$
Replace matches with: $1/0$2
[_] Case sensitive comparison

Action #3
Actiontype 4: Replace with regular expression
Field: TOTALTRACKS
Regular expression: ^(\d)$
Replace matches with: 0$1
[_] Case sensitive comparison

End Action Group Format 1#TRACK + TOTALTRACK Add Leading Zeros (3 Actions)

Format_1_TOTALDISKS__Discnumber_.mta (150 Bytes)

Format_1_TRACK__Track__Totaltracks_.mta (365 Bytes)

Format_1_TRACK___TOTALTRACK_Add_Leading_Zeros.mta (170 Bytes)

May not be relevant to your use case, but for the sake of future googlers:

Most of the time you'll keep your "master set" of tags in your FLAC files, and as long as you're using the right fieldnames, Foobar2000's built-in conversion routines (actually it uses configurable external EXEs) will handle not only this specific tag mapping but dozens of others automatically and transparently at encoding time.

The only two mappings I'd like to use that FB2K doesn't handle is RELEASETIME -> TDRL and musicbrainz' TrackID -> UFID .

Minor quibbles indeed.

Their weird fieldnaming conventions are another matter, but so far I haven't taken the time to find another automated solution that does a better job, the options I've come across so far haven't been updated for many years and therefore I suspect aren't as up to date wrt IOS-device compatibility.