My Life


What to do!

I’ve got three major programming projects to do right now and I’m so torn as to which one to start first.

The first one should be fairly simple, as I’ve already done it once. I just have to copy the information from one project to another project that uses the same stuff (It’s great when projects are just copied that way the logic, code etc is all the same)

The second one is just generating reports. Very boring shit. I already have the MySQL select statement for it (That was another post). But I have to create the output from it now. Again, pretty simple, but boring as hell. I like making the statements and figuring out the hard shit. But when it comes to the easy part of it I just don’t want to do it.

The last one is a personal project. I’ve got three copies right now of my iTunes library. One on my Powerbook, one on my Desktop and one on my iPod. The one on my iPod is the one with all the good playlists and the song counts. The one on my desktop is pretty much empty but I have created a few playlists that I like and the one on my powerbook is brand new and just has like 60 songs that I’ve downloaded recently.

What I want to do is to create a script that would take the play count and the last played information from the powerbook and the ipod and merge that into the library of my desktop (As the desktop is the “main” computer, it’s where all the music is really housed for now. Once I get my Terastation that will all change). The iTunes library is a very straight forward xml file. Here’s an exmample:

Track ID62

Namedon't wanna know

Artisti f williams

Albummidwest blvd

KindMPEG audio file


Total Time207856


Date Modified2004-04-28T05:31:18Z

Date Added2005-06-14T06:55:46Z

Bit Rate128

Sample Rate44100

Play Count2

Play Date-1090388574

Play Date UTC2005-07-19T07:45:22Z

Track TypeFile


File Folder Count4

Library Folder Count1

So there are three places that I need to update: “Play Count”, “Play Date”, and “Play Date UTC”. These can just be copied from which ever is newer. I can also put in some logic that if they are equal, not to update anything. The real question is how do I determine when to add the play counts together. The first time I do it, everything will just get added. But if I do it subsequent times what determines what should be added to where?

I suppose, I could just reset all play counts on my powerbook and ipod after each merge. That way any new plays would be added to the main computers playcount would be new plays, and not old plays which have already been added in.

Now I’m sure you’re all saying. Why the hell go to all the work to do this? Well because, I have over 7,000 songs. That’s 19+ days of music. Some of these songs haven’t been listened too in over a year simply because they keep getting lost in the suffle. Other songs get listened too all the time, because I know I like them and seek them out. I have a playlist called. “Unplayed Songs”. Whenever I just want background music I put it on this playlist and let it go. That way I have new music playing that I haven’t heard in a while. With adding playcounts together this will ensure that I hear songs I don’t seek out on a semi-equal share of time as songs that I do seek out. (Because of the way this is playlist is set up, the most infrequently played songs are automatically put on it).

Once I get my TeraStation and my PowerMac (Or Mac Mini, depending), this will all make life easier. My iPod hasn’t been updated since I bought it because it has all the good playlists that I like on it. However they were lost sometime when my External HD crashed (What was that, like Nov or something?) But once I get my Desktop Mac, that will become my main computer, and thus make it easier to move my XML playlists between the two (as the PATH will be the same).

I also have the delima of searching for songs. My Powerbook has ~60 songs, my Desktop over 7K and my iPod about 5k. So not every song is going to be in each playlist and they aren’t all going to have the same keys. I thought of seaching on the PATH, but they are different between the Powerbook and the WIndows Desktop, so that won’t work. Which leaves me one option. Double searching on the Artist and Song Name. Very annoying. I’ll have to remember how to search too! Damn Bennett.. Driving search functions into our heads!

I’m really almost tempted to extract all the XML info into a Database and work from there then recreate the XML file… But I’m sure in the long run that will be harder. But who knows really?! I mean, how am I going to write to the file too? I’m going ot have to open at a certian spot and then overwrite at the same spot with different info making sure that nothing is really fucked up. And let’s face it, I’m not THAT good of a programmer.

In other news, my life is boring as you can tell.

Night all.

2 replies on “Programming”

It is not the fun option but it is the smart one – take care ov business first and then work your play list problem. Gotta make the money so you can afford to play on the important stuff.

Very true, and is of course what I’m going to do!

I’ve already knocked Number 1 out. Now I’m waiting for manager approval of number 2 to make modifications!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.