Here’s another little patch for MPD‘s git repos that allows FLAC files to return md5sum as if it were a bit of metadata, like artist, title, or album.  A FLAC file’s md5sum is about the closest thing you can get to a unique identifier for that file.  The md5sum is generated from the wav file that is encoded when the FLAC file is created, so even if you change the filename, or its tags (vorbis comments), the md5sum will remain the same.  This code is how Mildred correlates songs playing in MPD with songs in its database.

You can find the patch here: http://kill-0.com/patches/0001-Adds-FLAC-md5sum.patch

After applying the patch, you’ll want to re-create your MPD database file.  You can use the --create-db flag to do so, or just delete your old database file before restarting MPD.