verify md5?

I created md5 of my music collection with mp3tag. Can mp3tag verify md5?

Media players keep messin' with the file dates and tags/content, which makes my backup utility back up more files than needed. All I really care is that %_md5audio% matches, so I don't have to keep copying the entire music folder over and over again.

Thanks for your help.

If you have the MD5 data stored inside a tag, you can create an export configuration and look if the string %_md5audio% was found in your tag field using $strstr(). If yes, tell Mp3tag to write "OK", otherwise write "Error".

Something like...

$loop(%_path%)%_path% - $ifgreater($strstr(%_md5audio%,%field_containing_hash%),0,OK,Error)
$loopend()

Hi Sebastian, thanks for your help :slight_smile:

Nice idea! Here is what I have so far.

I open some mp3s.
Sort by Filename (Ascending).
Edit > Select all files.
Right-click on the first file in the list > Export the checksums to a text file md5.txt with the following script:

$loop(%_filename%)%_md5audio%
$loopend()

Then I import them back by Right-clicking the first file again (while they are all still selected)

Convert -> Text file - Tag

Using the format string %isrc%

As you see, the Convert -> Text file - Tag function will pull the checksums from md5.txt into the ISRC field.

This works, and I can verify it with your script above, by changing %field_containing_hash% to %isrc% and exporting to verify.txt.

Have I done it the best way? Or is there another way which doesn't involve exporting and importing the fields back in.

I tried creating a custom action but it didn't seem to work. It just wrote %_md5audio% in the field instead of the actual checksum.

Any other ideas?

Thanks a lot!

Your solution seems to be OK, as there is no way to tell Mp3tag to write the MD5 into the tags directly - it is only supported for exports as far as I know.

BTW, ISRC is not really the best field for storing MD5 data since ISRC usually contains the ISO 3901 code of the recording given by the IFPI.

Hi Sebastian,

I made a couple revises to my scripts. There was a bug in my method. When exporting the md5, and importing them back, the wrong md5 could get imported in some tracks!

Luckily, I figured it out after some time. In the md5 creation script, it is much better to loop by %_filename%, not %_path%

If you loop by %_path%, the exported checksums might be imported in the wrong order! Because, for some reason or other, mp3tag sorts the paths columns differently in the GUI than in the exported txt file. Therefore verification would fail.

The exported file resulting from my revised script will match up correctly when the GUI has been sorted by the Filename column. I will update my last post with the changes.

In the mean time, which field would you recommend storing the checksums in? I thought about using the comment field, but I already have interesting comments in many of my songs!

~ss

You can create your own "CHECKSUM" or "MD5" field. Both ID3v2 and APEv2 support that.

Got it! Thanks again for your help!

~ss