find out incomplete albums

is it possible to go throuth all the songs that belong to one album and count the tracks. If there is one track missing, i.e. if the total track number is not equal to the highest track number than that album must be incomplete.

is it possible to get a list of all that albums?

How do you know the real number of tracks in an album?
Provided you have it ...
Copy all original tracknumbers to a user defined field e.g. tmp_track.
Sort all tracks first by tracknumber, then by album.
Now start the track numbering wizard with the option to reset the numbering per folder.

Then apply a filter that compares the two track fields:
$if($eql(%track%,%tmp_track%),1,0) IS 0

This should show all files where the new numbering does not match the original numbering - and the only explanation would be that there was a gap.
I think.

the field track contains the original number, but sometimes a track is missing in an album.
how can i automatically create a new field for every mp3 and number them automatically, not album per album but the whole collection at once?

The track numbering wizard is the only tool that has a reset per folder. This works for the whole collection as long as each album has its own folder.
So, to keep the original numbering, you have to copy it to the tmp-field as it would be lost otherwise.
After you have found the incomplete albums, you can copy the data back to the track field.

It should be possible, what have you tried so far on your own?

To make it short ... you can test this export script ... without any warranty ...

01: $filename($getEnv('USERPROFILE')'\Desktop\MissingTrack.txt',UTF-8)$loop(1,1)$puts((c),'©DD.20140318.0856')$puts(crlf,$char(13)$char(10))$puts(br,'{br}')$puts(result,)$puts(check,0)$loopend()$replace(

02: 'Possible missing track in album'$get(br)
03: '-------------------------------'$get(br)
04: $loop(%_folderpath%)$replace(
05: $loop($num(%TRACK%,2))$replace(
07: $puts(result,$if($eql(%_counter%,1),'OK',$get(result)))
08: $puts(check,$if($eql(%_counter%,1),0,$get(check)))
09: $puts(result,$if($eql($num($add($get(check),1),2),$num(%TRACK%,2)),$get(result),'MISSING'))
10: $puts(check,$add($get(check),1))
12: ,$get(crlf),,$get(br),$get(crlf))$loopend()
14: $if($eql($get(result),'OK'),$ifgreater(%_total%,%_total_files%,'"'%ALBUM%'";"'%_folderpath%'"'$get(br),),'"'%ALBUM%'";"'%_folderpath%'"'$get(br))
16: ,$get(crlf),,$get(br),$get(crlf))$loopend()
18: $get(br)$repeat('-',40)$get(br)$get((c))', '%_datetime%
20: ,$get(crlf),,$get(br),$get(crlf))


i want first try your suggestion, thx.
yes i found the numbering wizard (ctrl-k).
how can i copy the field track to tmp_track?

Create an action of the type "Format tag field".
Enter for field: tmp_track
Enter for format string: %track%

thx, that works well.

but after automatically nubering of all albums, how can i compare the tmp_track with track? and if not equal for all tracks set %complete_album% to 0 for all tracks else set to 0 for all tracks of this album.
all should run automatically.

i tested your export script, and it seems that it works fine, thx a lot.

but i need now some automatism to automatically set for all those albums the tag %complete_album% to 0
for all complete albums i want to set it automatically to 1

any suggestion from your side?

Just for the moment ...
when you got the report file with such entry like this ...
"Album A";"M:\Music\Artist\Album"

... then copy the path string ...
into the "Directory" edit field within the Tag Panel [Ctrl+Q] and press [Enter].

Mp3tag loads the files from this folder.
Then you can run an action against the files to remove the tag %complete_album% or set the tag %complete_album% to 0.
This procedure has to be done for each detected folder in the report file.

To automate the tagging procedure for all detected folders at once, this is the next challenge.


that means i have first go through the mediathek manually?
honestly, i now think this is the safest way, because till now i realized there are some special cases albums where i have to manually update some information. so automatism would be nice, but i think it can never reach all cases.

btw. thanx a lot for your effort creating this really helpful export script.
amazing this script recognizes an incomplete album even if the last track number is equal to the number of availiable tracks, e.g. one is missing but another one comes twice ..... great work!!!

The following mte script creates a text file of type M3U8 playlist, which can be used by Mp3tag.
Note: Do not play or execute the m3u8 file, ...
but use Mp3tag to open the m3u8 file, ...
or "drag and drop" the m3u8 file onto the running Mp3tag application window.

01: $filename($getEnv('USERPROFILE')'\Desktop\MissingTrack.txt.m3u8',UTF-8)$loop(1,1)$puts((c),'©DD.20140903')$puts(crlf,$char(13)$char(10))$puts(br,'{br}')$puts(result,)$puts(check,0)$loopend()$replace(

02: '### Possible missing track in album'$get(br)
03: '### -------------------------------'$get(br)
04: $loop(%_folderpath%)$replace(
05: $loop($num(%TRACK%,2))$replace(
07: $puts(result,$if($eql(%_counter%,1),'OK',$get(result)))
08: $puts(check,$if($eql(%_counter%,1),0,$get(check)))
09: $puts(result,$if($eql($num($add($get(check),1),2),$num(%TRACK%,2)),$get(result),'MISSING'))
10: $puts(check,$add($get(check),1))
12: ,$get(crlf),,$get(br),$get(crlf))$loopend()
14: $if($eql($get(result),'OK'),$ifgreater(%_total%,%_total_files%,%_folderpath%$get(br),),%_folderpath%$get(br))
16: ,$get(crlf),,$get(br),$get(crlf))$loopend()
18: $get(br)'### '$repeat('-',40)$get(br)'### '$get((c))', '%_datetime%
20: ,$get(crlf),,$get(br),$get(crlf))


Note: For usage in Mp3tag the given script text from above needs additional homework to do.

  1. Select the given script text in the forum window and copy it to Windows Clipboard.
  2. Open a text editor application and paste the Clipboard content into a new empty file.
  3. Remove each line number "nn: " to align this code line at the left edge.
  4. Save this Mp3tag export script into the Mp3tag folder for MTE files ...
    ==> "%APPDATA%\Mp3tag\export", ...
    ... write a descriptive file name ... e .g. "Export.PossibleMissingTrack.m3u8.mte"
  5. Open Mp3tag.
  6. Load one or more album folders, with or without correct track numbering, to test the functionality of the MTE script.
  7. Choose "Export" from the Mp3tag File menu, select the MTE script and execute the script against the selected files.
  8. At end of run there should exist a playlist text file on the Desktop with the name "MissingTrack.txt.m3u8".
  9. You can open this m3u8 playlist textfile with any text editor to check the content.
    If there has been detected possible missing tracks, then the playlist file contains one folderpath for each detected folder album.
    If there are no folderpath entries, then all checked folder albums are good and you are ready ...
    ... otherwise go to the next step.
  10. Open this new playlist file with Mp3tag.
  11. Mp3tag will load all files from the given folderpathnames into the listview.
    If the listview remains empty, then the playlist has no entry to be loaded.
  12. Do your work with the loaded tracks in Mp3tag.


Export.TXT.20140903.PossibleMissingTrackInAlbum.m3u8.mte (914 Bytes)

Export.TXT.20140903.PossibleMissingTrackInAlbum.m3u8.mte (914 Bytes)

ok, i tested this script in the following way:

  1. i draged some albums into mp3tag which are incomplete and complete
  2. i created the script named set_complete_tag.mte containing your script
  3. i draged the script into mp3tag
    => nothing happened, but the albums are cleared from mp3tag

can you give me a clear instruction how to proceed?

btw. is it possible to post script code without that line numbers, that i have to delete manually each time.


You have to store the script in the export-folder for mp3tag.
You open an export script with

ok, thx, now it generates an m3u8 script (i did not know that mte is the export-script-extension)

if i drag'n'drop this file into mp3tag all albums get cleared in mp3tag now.

do i also have to place this m3u8-file to a special location?

No, not really.
the m3u8 file is just a playlist.
you can open it with a plain text editor to check the contents.
If there are no tracks in the playlist, then apparently the albums are not incomplete.
If there are tracks, check if you have applied a filter that finds no match in the files.

thx alot, i think now i got the point.

but what's a bit of a trap is, that all top directories are also included in this list, i.e. a, b, c, d, .....
so this playlist makes mp3tag to load all subdirectories also

but if i switch off subdirectories in the options then it works .....

2morrow i'll check the rest, but for this, THANK YOU A LOT, i really know how much programming and debugging effort this must be.



ps. thx for adding the detailed description to the original post of your source code of the export script to create the playlist.