Proving the Sunshine

Sep 28 2009

Sometimes, You Can't Wait for Apple to Fix It

Click here to download:
KillComputedRatings.scpt (1 KB)

I’ve been wailing about this silly bug in iTunes for a while. Basically, iTunes tries to be cute and calculate a rating for unrated tracks based on the album rating or an album rating for unrated albums by the rating of individual tracks. If you use smart playlists that have rating or album rating in the criteria, iTunes can’t actually exclude any of those calculated ratings from the predicate that creates the smart playlist. So, if you rated an album a **** overall but you haven’t yet rated the individual tracks in the album, all of the tracks that are unrated will have a **** calculated rating. Create a smart playlist with rating at least **** and you’ll end up with those unrated tracks in your playlist. Awesome, huh?

I was sincerely hoping that iTunes 9 would fix this stupid bug. (To prove how stupid it is, you can look at the Applescript dictionary for iTunes. There’s already a flag for whether the rating or album rating is calculated.) Unfortunately, that doesn’t appear to be the case. According to Apple, the engineers are aware of the bug and will fix it… well, whenever they get around to adding that little BOOL check I guess.

In the mean time, I got tired of waiting. Since the problem is that the ratings are calculated rather than actually set, I ran a dumb Applescript to set the rating and album rating to every track that had a calculated rating for either of those items to 1 rather than 0. (Ratings are on a 0-100 scale.) The tracks still show as a zero star rating or album rating but now they don’t pollute my smart playlists because they’re no longer calculated. Here’s the script:
 
tell application "iTunes"
repeat with t from 1 to count of every file track of library playlist 1
set thisTrack to (file track t of library playlist 1)
if rating kind of thisTrack is computed then
set rating of thisTrack to 1
end if
if album rating kind of thisTrack is computed then
set album rating of thisTrack to 1
end if
end repeat
end tell

It’s pretty stupid really to have to do this and have to do this for new tracks, but it’s fast enough for me on my paltry 25GB collection until Apple decides they want to fix it.

Posted via email from jxpx777’s posterous | Comment »

Comments (View)
blog comments powered by Disqus
Page 1 of 1