Economy of Effort

Twitter LinkedIn GitHub Mail RSS

A Simple Plea For "Album" Browsing On I Pod

If you own an iPod and listen to complete albums, but also have mix playlists, then you know the problem very well.

[caption id=“attachment_374” align=“aligncenter” width=“280” caption=“This image should not be taken as an endorsement of Nelly Furtado’s music. I couldn’t find an iPod Classic Cover Flow image to steal that had Made Out of Babies on it.”]This image should not be taken as an endorsement of Nelly Furdado's music. I couldn't find an iPod Classic Cover Flow image to steal that had Mouth of the Architect on it.[/caption]

You’d like to be able to browse through your albums, but the Artist, Album, Cover Flow, etc views are cluttered with the artist and album names from your mix playlists.

Tons and tons of “albums” with all of 1 or 2 tracks in there, mixed among your actual full albums.

It is my assertion that players like the iPod should have an “album browser”, which is smart enough to only display complete albums.

But how would it know what’s a complete album? Well, some simple logic and ID3 metadata is all we need. How do you know when you’re looking at a full album in iTunes or not? Probably when you look at the track numbers and see track 1, track 2, etc., in an unbroken order up through 6 or 8 or 10 or so. Also, you can list how many tracks an album has in the ID3 tag, so that instead of simply track “1”, the MP3 appears in iPod/iTunes as “1 of 9”. If the tracks are numbered like that and there’s something missing in the order up through “9 of 9”, then you know the album isn’t complete.

Sometimes, albums are only 1 or 2 long tracks. And perhaps the disc is an EP or a single and has only 3 or so tracks and a short running time.

With a little bit of programming logic, we can come up with a very simple algorithm that will match almost all complete albums, with few false positives (or false negatives). It’s not 100% bulletproof perfect, but it’s a WHOLE lot better than nothing at all.

The logic would go something like this (for non-programmers, the stuff to the right of  # signs are comments explaining the pseudocode, and not “code” itself):

for each album:

   # Runs if album track numbers are listed as "1 of 9", "2 of 9", etc.
   if (tracks have metadata listing number of tracks - eg. the "y" in "1 of y"):
      if there exist tracks numbered 1 through y, with none missing:
         complete = true
         # Album is missing at least 1 track between "1" and "y"
         complete = false

   # Runs if album track numbers are listed only as "1", "2", etc.
   else (tracks are missing the metadata listing the number of tracks an album has):
      if there exist tracks sequenced 1 through some number X, with none missing:
         # If there is a sequence of tracks starting from 1 that exceeds 4,
         # we'll assume it's a complete album
         if X > 4:
            complete = true
         else if (running length > 25):
            # If there are 4 or fewer tracks, but the running length exceeds
            # 25 minutes, we'll assume it's a complete album
            complete = true
            # It's 4 or fewer consecutive tracks and is short,
            # probably just a partially downloaded album
            complete = false
         # Does not have tracks numbering from 1 through X in an unbroken sequence
         complete = false

That’s it. Given a normal collection, which doesn’t have a ton of albums that are half-downloaded, this will yield almost perfect complete album matching.

With a little more thinking and research, we could refine this to further avoid false positives. I pulled the thresholds of 4 tracks and 25 minutes out of thin air. There may be more appropriate thresholds that result in more hits and fewer misses. But the point is that the general idea is sound, and that these numbers could be easily tweaked.

If someone allows a lot of half-downloaded albums to get into their collection, then the X > 4 rule might hit a number of false positives. But the idea, at bare minimum, is to work well for well-formed MP3 collections. We could raise this total, but I didn’t want to exclude 5 and 6-track EPs. And of course, only half-downloaded albums that are tracks in order starting from 1, AND missing the track total metadata, would hit this rule.

Best of all, anyone who has issues with certain albums not matching could easily fix it by adding the “number of tracks” metadata to the albums that aren’t being matched. If it really is an 18 minute, 3 track album, all you’d have to do is edit it so the track numbers are “1 of 3”, “2 of 3”, etc. so that it would be matched against the first rule.

Now, an online-enabled music manager could compare tracks with its online database to confirm completeness. iTunes' “Genius” already scans a complete collection and interacts with an online server - it would not be difficult to have it check albums against an online database and flag albums as “complete” or not in the iTunes database. But the above is a solution that would yield extremely good results for the vast majority of collections, and requires nothing but the information in ID3 tags and a small bit of programming logic.

I would love a “Complete Albums” browser view on my iPod. Or even just a “hide incomplete albums” option to toggle, to enable and disable this sort of filtering in the Genre, Artist, and Album browser views. That would be so fantastic.