So, now that the new website is running I thought it would be cool to do something with all the metadata which sits on my iPod and in iTunes. I could do something like a “Currently listening to…” in a sidebar on the website, but something which would be even cooler would be to do some trending of usage.
iTunes has fields for play count, last played date, date added. Therefore, my thought was that a simple routine could be run periodically against the library which would pick out the current play count for each track and store it in another database with a timestamp.
Then I could run reports…which tracks were the most popular in the last week? Which ones had fallen from favor? Then to complete the cycle, it could use the iTunes API to create a playlist with the results.
The problem with this whole setup - there’s no unique ID which one can use to match between iTunes sessions. All of the Apple documentation I’ve been able to find reiterates over and over again that the trackDatabaseID, which one would think would be what I was looking for, is only guaranteed to be static during an iTunes session.
Now, I suppose I could try and create a unique ID by storing something in an ID3 tag or using a combination of other attributes, and I may just do that. But it still is kinda a pain.