Breaking radio silence to complain about something both trivial and technical, so it’s probably best if everyone skips this post. Unless you write a CD ripper or audio tagger. Then please read this post, because I’m going to explain why you’re wrong. (Someone emailed me about why Quod Libet
acts this way, and I figured I’d make my answer public, with the hope it helps things.)
History
Decades ago, before there was Ogg Vorbis, people used an obsolete standard called MP3, and tagged it with something called ID3 (in particular, ID3v2). One of the possible tags was TRCK, for the track number. It was stored as a string in “x/y” format, for track number x out of y total tracks. Perhaps this could be improved upon; maybe not (I’ll make a case for not later). Regardless, that’s how hundreds of thousands, if not millions, of files were tagged.
Ogg Vorbis Comments
These days we have something better — Ogg Vorbis
and its tagging format. Vorbis specified a tag called
tracknumber, analogous to TRCK.
TRACKNUMBER: The track number of this piece if part of a specific larger collection or album
Now, this is a bit ambiguous. In particular, TRCK says how you should store the total number of tracks, and the Vorbis comment specification doesn’t. A strict reading indicates you can’t, but then the same standard is designed to be particularly loose about the data stored in the tags. So a lot of programs,
including really popular ones, just kept their ID3 format and wrote tracknumber=x/y. Everyone was happy.
Then someone — I wish I knew who, so I could write this to them personally — decided trying to parse the track number in this format was too hard, and so decided they would make a
tracktotal tag that stored, as a single number, the number of tracks.
Whoever Did This Is Wrong
Whoever decided to do this was pretty dumb. There’s a number of false assumptions here, roughly in decreasing order of annoyance:
- When you make a new standard, people won’t follow it (assuming otherwise is one of the stupidest design decisions possible). Lots of programs still wrote the x/y format. Quod Libet still does. I think it’s a better format. So now all that happens is everyone needs to implement both formats.
- When you make a new standard, people won’t follow it (as bad as it is, they made this mistake twice). Anything that does Vorbis tags probably does ID3 tags, and ID3 isn’t going away any time soon. So you still need the x/y parser no matter what.
- When you make a new standard, people get it wrong. So now we all need to support totaltracks, tracktotal, and x/y.
- Every other new tagging standard uses something much closer to x/y. Apple’s MP4 metadata, for example, uses two bytes in a single trck value. APEv2 uses Track=x/y. This is pointless differentiation.
- x/y is not hard to parse. There’s a horrible function called atoi that does it, and a lot of better ones.
- Using a simple numeric string still needs atoi and friends, because you don’t want “2″ to sort after “11″.
- You’re just trading parsing for reconstruction later. Quod Libet displays “Track [tracknumber]” which gets it right every time. Otherwise you have two strings “Track [tracknumber]” and “Track [tracknumber] of [tracktotal]” (no, you can’t just have “of [tracktotal]”, that ruins i18n).
- Users would rather enter a single “tracknumber=1/21″ than “tracknumber=1; tracktotal=21″.
- All else being equal, tracknumber=x/y is shorter. Maybe not a big deal, until we see a proliferation of discnumber (requiring disctotal, and totaldiscs), partnumber (requiring parttotal, and totalparts), and …
The result is that every program still needs to understand x/y —
even if every Vorbis file used the new format — and the new format, and
also needs to do the work to construct track numbers in the new format, assuming it wants to use them. That’s why Quod Libet converts everything to x/y format.
I urge authors of tagging applications and CD rippers to abandon stupid standards. Instead, you should be spending time fixing your ID3v2 readers and writers, because they all suck too.
P.S.
If anyone knows what program is putting ISO-8859-1 values into Vorbis tags, please let me know. I have spiked cluebat for you.
A Summary of Other Things
I moved into a new apartment building next door to my old one, owned by the same student co-op, so it doesn’t actually seem like I moved at all. School started and is going well. I saw DOOM earlier this week for free, and enjoyed it. I’ve learned a lot about Python i18n over the past few months and am writing a brief howto explaining how to do it properly.