How to get iTunes to play nicer with external tagging applications

id3-tagitunes

I have what I consider to be a large iTunes Library, ~38 days of music. Worse? I'm a stickler for tags to be correct. Worse still? I'm SUPER lazy, and like things to be done for me as automatically as possible.

Some time ago I used a piece of software that had a particularly nasty bug which corrupted the tags on all of my songs with non-latin characters. I've since updated and re-run the same piece of software, and as I play songs previously corrupted, I see their tags update and become correct and intact again. However, after some amount of time, it seems that the tags revert back to their corrupted state.

This seems to manifest itself in other songs where no corruption has occurred, but the comments and some other custom keys I encode into the files disappear, or revert, as well.

I think this is because there is the tag data in the files themselves, but also in the iTunes Library files (itdb, itl, and xml files). I think that the data in those files are taking precedence, or failing some sync, or in general just failing in mysterious ways causing the above stated issues to occur.

What is the best procedure for updating a large chunk of tags in my library, and ensuring iTunes sees them, respects them, and will not continue to muck with them any further?

Best Answer

This is what I have done:

I backed up all my files, and then deleted ALL my music from my iTunes Library. I could swear I said "delete from iCloud", but that obviously did not occur. Some of the aforementioned data stuck around, and I didn't lose playlists I was quite concerned I had neglected to back up.

I tagged my files externally, re-imported them into iTunes, and everything began to work fantastically (well, mostly, but the issues are better left for another question).

Fast forward to about two days later, certain songs started exhibiting the same corruption. I again have songs that are tagged as being on disc 1 of 128602 discs (note: completely wrong). iTunes Match is definitely at play here. But I assumed that already.

I've been looking into how other apps interact with iTunes, and stumbled across iTunes integration plugins for MusicBrainz Picard. The tagging app I prefer to use en massé.

I don't know if these plugins are still compatible with Picard, Picard has come a long way (especially as of the 1.0 release last week) since these plugins have been touched; But there is a lot of interesting notes. The author talks explicitly about notifying iTunes that there are changes, something the plugins will apparently do, but also points you BACK TO MusicBrainz, which lists some additional steps you can take to updating iTunes.

I have an AppleScript that will invoke the "refresh selection" suggestions per MusicBrainz, but I have not yet fixed my tags... again. And even after that, I don't know exactly how long it takes for tags to revert and become corrupted again.

This road is still worth investigating further, but it's a hard one. I'm not exactly sure how to dig into the iTunes Scripting Bridges or other internal facets of iTunes itself in order to reliably update tag data from external applications, but that's certainly what should be done. Update it, and tell iTunes you updated it. Especially when an external repository of metadata is at play.