Friday, March 10, 2006

Version 2.2.1

Version 2.2.1 has just been released. It fixes a few bugs that have been a thorn in my side for quite some time.

Fix 1:
Previously, if the user moved their iTunes library, there was a chance that their "iTunes Music Library.xml" file would be moved too. Generally this didn't occur if they moved it via the iTunes Preferences, and allowed iTunes to migrate the music files for them. But occasionally, users would move the files manually (including the xml file) and just slap an alias in the original location. What they didn't know is that these aliases are not automatically readable by the filesystem or by applications. Developers have to go in and specifically add code to check for aliases, and then add code to follow these aliases. Needless to say this is a pain in the arse for us developers, but then again, aliases have their virtues. Well, I've finally added the 500 lines of code to deal with this problem, so hopefully it shouldn't happen again.

Fix 2: (More iTunes library XML problems...)
Occasionally, after making changes to your iTunes library, the song that you selected to play would skip to another song nearby the original. This is because the application previously stored the "Track ID" for the song. This track ID is needed to lookup the song in the XML file, but unfortunately this track ID isn't persistant. iTunes creates the XML file everytime you change your library, so everytime it gets created, there is a small chance the track ID of a song may change. This is fixed by now storing a "Persistant Track ID", which can be validated against the "Track ID". If the track ID has changed, the persistant track ID can now be used to find the updated track ID. Sounds confusing? It's really not that hard. Just an extra little step in the process.

For more information about this crazy "iTunes Music Library.xml" file I keep talking about, go here: http://www.indyjt.com/blog/?p=51

10 comments:

Anonymous said...

Alarm Clock 2.2.1 looks very promising, but I can't set an alarm because the application quits on me whenever I click on the alarm time setting. Everything else doesn't kill it. I've got FileVault activated, and my iTunes library folder is on an netatalk 2.0.3 AFP volume, if that matters. I'm prompted for my password to mount the share. Starting iTunes (Tiger/latest) before Alarm Clock doesn't change anything.

Anonymous said...

Followup: No, don't have to click at all, it will quit all by itself:

2006-03-11 10:36:55.240 Alarm Clock[2758] Initializing AlarmScheduler...
2006-03-11 10:36:55.247 Alarm Clock[2758] Initializing AlarmTasks...
2006-03-11 10:36:55.248 Alarm Clock[2758] Registering for system power notifications...
2006-03-11 10:36:55.324 Alarm Clock[2758] Ready...
2006-03-11 10:37:01.428 Alarm Clock[2758] Parsing iTunes Music Library...
2006-03-11 10:37:01.489 Alarm Clock[2758] An uncaught exception was raised
2006-03-11 10:37:01.490 Alarm Clock[2758] *** -[NSCFString replaceCharactersInRange:withString:]: nil argument
2006-03-11 10:37:01.490 Alarm Clock[2758] *** Uncaught exception: <NSInvalidArgumentException> *** -[NSCFString replaceCharactersInRange:withString:]: nil argument
Trace/BPT trap

Robbie Hanson said...

From the looks of the program output, it crashed trying to resolve the location of your "iTunes Music Library.xml" file. It looks like it found an alias to this file (or an alias in the path to this file) and the alias pointed to nothing (nil). Is this correct? Is your Music folder (~/Music) an alias to the other volume by any chance?

Robbie Hanson said...

PS - Excellent bug report! I wish all the bug reports I got were as helpfull as yours!

Anonymous said...

Thanks for your attention and your kind words, Robbie.

~/Music is a regular folder; ~/Music/iTunes is an alias to /Volumes/music (Mac OS X, not ln -s style). /Volumes/music is mounted when the crash happens, and iTunes can use normally.

I also tried AC2.2; it basically works but cannot find the iTunes library, and cannot wake up my iBook G3 w/ FileVault. An iMac G3 w/o FV, on the other hand, cannot find any music either, but wakes up fine. Both machines are running Tiger, and access the "music" share provided by a Buffalo Linkstation.

-Andre

Anonymous said...

I really love the alarm clock. One item on my wish list -- it would be great if there was an option to display the clock while waiting for an alarm to activate (to be able to use it like a real alarm clock where the clock is visible).

Thanks!

Robbie Hanson said...

The application is supposed to resolve aliases just fine. I tested a few aliases on my machine, and all were resolved perfectly. Perhaps it has something to do with aliases on separate volumes. I'll have to look into this. Thanks for the heads up.

Also, I had no idea that there were "wake from sleep" problems when file vault was turned on. I have NO idea why this would be. The wake from sleep procedure doesn't even read or write any files... Once again, I'll have to look into it, and thanks for the heads up.

Robbie Hanson said...

Hi Charlie,
Thanks for the feedback. This is the first request I've had for such a feature. It certainly wouldn't be that hard to implement... I've got a few cool features in the works, but I will certainly look into it when I get a chance.

Robbie Hanson said...

Wow! So... I'm a complete idiot. I can't even copy and paste code correctly.

I tried sticking my iTunes library xml file on an external drive, and an alias to it in the original location. I got the same error as was reported, with a nil argument exception. So I went back and checked by "resolve alias" code, and I managed to copy and paste part of it incorrectly (from apple's sample code).

So anyway, this is fixed now. And if anyone wants to help me test it, just shoot me an email, and I'll send you the latest build.

Anonymous said...

Robbie --

Thanks!

-- Charlie