One problem with the iPod is that it doesn't store mp3 files by name anywhere. All the mp3's are stored in hidden directories by numbers. So I was at work and wanted a way I could move songs onto my hard drive there and listen to them. I found a neat piece of open source freeware called SharePod that lets you do just this as well as export playlists or just play songs from your computer that are on your iPod. It does this by running a program that you store on the iPod itself so you don't have to install anything on the host computer.
But after extracting a few songs onto the hard drive I found I was missing my album playlists that I had on my Archos and in my folders at home. So I wanted to have the songs sort correctly by track number, but SharePod doesn't get the track numbers or have any way to incorporate them into the file name.
I took the source files home and started poking around in the Visual Basic code. It was very confusing because I didn't even know what the structure of the database was (the file on the iPod where all the data is stored is called iTunesDB). It's not like they're just going to make it normal so there are all these nested records, where a song has one record but then the title, artist, etc. are stored in separate records within that record (not fields, records).
I found a page on SourceForge that described the structure of the various records and another page that described how the records worked together.
Eventually I figured it out, made some changes to the SharePod source files, compiled a new executable (after fixing one typo), and ran a prototype that would test whether I could pull in the track numbers. It worked the first time!
Then I needed a way of incorporating the track numbers into the file names. I made a couple of more changes, compiled a new executable, and it worked on the first try too! That never happens.
Other than comments I really only added about 15 lines of code and changed two of the objects on the program forms. But you have to know how to add it and where.
Anyway, I wrote to the author of the program to tell him thanks and about my modification. You can download the executable from my website. I can send source files if someone needs them, but you probably should go to the author's page at the link above.