Fixed my iTunes library "date added" to work better with Roon library imports

I’ve got an iTunes library that dates back for well over a decade. As part of my migration from using iTunes as my primary music player to using Roon, I added my iTunes media folder as a library for my Roon Core server. This works great, except I’ve noticed that the “date added” for the tracks in my library were very unreliable.

First the date added showed up as this week for every track, but I quickly figured out that I could fix that changing the Roon “Library > Import Settings > Track Import Dates” to use File Creation Time instead of Roon Import Timestamp.

But that still left a bit of a mess. macOS filesystems don’t actually track creation time, just file modification time. As you can image, there are countless ways that file modification times can get unintentionally updated over the years, as you move your library around from drive to drive or move to a new computer, or move to a NAS. I found that my file times were very untethered from the true date I added each track to my iTunes library.

So… I wrote a tool that will parse the iTunes Library.XML file and correct any file timestamps that disagreed with the iTunes database’s added date for that track. I just ran it on my library and then forced a reload in Roon and now all my added dates are accurate to reality. Huge improvement for data geeks like me.

Source code and binaries are published at https://github.com/nugget/itunes-file-mtimes if anyone else thinks they might find this useful.

2 Likes

Hi David, i am interested in this. Does it still work?

Thanks

I haven’t touched this since I wrorte it, but there’s no reason why it shouldn’t still work. Let me know if you run into any issues.

Hi David, i have run the script and no changes.
There are still major differences between what I see on iTunes and Roon

Important to note that the ROOn (sort by date) is unchanged. This is the closet to itunes

Sort by date added is all over the place on Roon

It’s not clear to me what exactly you’re describing, so I don’t really have any advice for you. I assume when you ran the program it did things and printed out a log of its activities to the terminal window. Do you remember what any of that said? How confident are you that the program ran successfully?