Tuesday, July 13, 2004

iTunes XML practically useless

I wanted to do some cool XSL styling of my playlists that are exported from iTunes in XML.

Upon looking at the export file, however, I can't help but wonder why Apple, the king of usability, so poorly structured the file, that it's not very useful.

Here's an example:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" 
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Major Version</key><integer>1</integer>
<key>Minor Version</key><integer>1</integer>

<key>Application Version</key><string>4.6</string>
<key>Music Folder</key><string>file://blah</string>
<key>Library Persistent ID</key><string>A1A1A1A1A1A1A1A1</string>

<key>Tracks</key>

<key>44</key>
<dict>
<key>Track ID</key><integer>44</integer>

<key>Name</key><string>Axel F</string>
<key>Artist</key><string>Harold Faltermeyer</string>
<key>Album</key><string>Hits Of 1985</string>

			<key>Genre</key><string>Soundtrack</string>
<key>Kind</key><string>AAC audio file</string>
			<key>Size</key><integer>2982666</integer>

<key>Total Time</key><integer>183228</integer>
<key>Track Number</key><integer>8</integer>
<key>Track Count</key><integer>12</integer>

<key>Date Modified</key><date>2004-01-30T04:46:44Z</date>
<key>Date Added</key><date>2004-01-27T03:15:52Z</date>
<key>Bit Rate</key><integer>128</integer>

<key>Sample Rate</key><integer>44100</integer>
<key>Play Count</key><integer>3</integer>
<key>Play Date</key><integer>-1134773809</integer>

<key>Play Date UTC</key><date>2004-02-21T13:31:27Z</date>
			<key>Rating</key><integer>100</integer>
			<key>Normalization</key><integer>316</integer>

<key>Compilation</key><true/>
<key>Disabled</key><true/>
<key>File Type</key><integer>1295270176</integer>

<key>File Creator</key><integer>1752133483</integer>
			<key>Location</key><string>file://blah</string>
<key>File Folder Count</key><integer>4</integer>

<key>Library Folder Count</key><integer>1</integer>
</dict>
</dict>
</plist>

The key and integer pairs aren't terribly useful. If you have a standard set of data you are tracking in these files, why not make them elements and give them useful names?

For example, why not export it like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE play_list PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" 
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<play_list version="1.0">
<iTunes>
  <major_version>1</major_version>

  <minor_version>1</minor_version>
  <app_version>4.6</app_version>
<music_folder>file://blah</music_folder>
  <library_ID>A1A1A1A1A1A1A1A1</string>

  <tracks>40</tracks>
</iTunes>
  <list_track>
    <track_ID>44</track_ID>
    <track_title>Axel F</track_title>

    <artist>Harold Faltermeyer</artist>
    <album>Hits Of 1985</album>
<cddb_id>http://www.gracenote.com/xm/pcd/genrock/459dcb773ee5459782b61a81615b4fd0.html</cddb_id>
    <genre>Soundtrack</genre>

    <format>AAC audio file</format>
    <size>2982666</size>
    <track_length>183228</track_length>
    <track_number>8</track_number>

    <track_count>12</track_count>
    <date_modified>2004-01-30T04:46:44Z</date_modified>
    <date_added>2004-01-27T03:15:52Z</date_added>
    <bit_rate>128</bit_rate>

    <sample_rate>44100</sample_rate>
    <play_count>3</play_count>
    <play_date>2004-02-21T13:31:27Z</play_date>
    <rating>100</rating>

    <normalization>316</normalization>
    <compilation>true</compilation>
    <disabled>true</disabled>
    <file_type>1295270176</file_type>

    <file_creator1752133483</file_creator>
	<location>file://blah</location>
    <file_folder_count>4</file_folder_count>
    <library_folder_count>1</library_folder_count>

  </list_track>
</play_list>

Now that wasn't so hard was it? Now how do we get Apple to change the format?

See also:

1 comment:

Anonymous said...

Argggh! My eyes! Bright yellow text on a white background?