This is a solution to a problem that had bugged me for a while. A minidisc generally holds either 74:59 or 80:59 of music; an album ranges anywhere between 30 to 50 minutes. So if you're lucky, you can squeeze 2 albums on 1 disc - but the problem is finding the second album that'll fit. Well, mdhelper does the grunt work for you. Tell it what album you're dubbing, and the options for the others, and it tells you what will fit, thusly:

[alex@aquila Playlists]$ mdhelper -n -t Soulwax\ -\ Much\ Against\ Everyones\ Advice.m3u *-*
Minidisc length: 74:59
Album length: 38:35
Remaining space: 36:24
Albums that fit within available space:
Air - Premiers Symptomes (33:49)
Andrew WK - I Get Wet (35:31)
Kraftwerk - The Man Machine (36:18)
Nick Drake - Pink Moon (28:28)
The Coral - Nightfreak and the sons of Becker (28:00)
The Divine Comedy - A Short Album About Love (31:56)
The Smiths - Strangeways here we come (36:03)

Albums that nearly fit in available space:
Mike Oldfield - Ommadawn (36:40)
Soundtracks - Man On The Moon (37:01)
The Smiths - The Queen Is Dead (37:01)
The Strokes - Is This It (36:24)
Tommy Cooper - The Very Best Of (37:18)

This code is still a little hairy; it works fine, but it's not that well documented. Options are as follows:

  • -h - show help (although it's not accurate).
  • -n - give nicer output - call playlists albums, and strip out the path details and extensions.
  • -q - give quiet output - only output paths that do fit. Could be useful in shell scripting.
  • -t targetfile - the playlist that's the "target" - that is, the one you want to get on the minidisc.
  • -l length - the length of the minidisc. Defaults to 74:59. Understands seconds, minutes:seconds, hours:minutes:seconds, and days:hours:minutes:seconds.

To install this, create a directory somewhere and untar it there. Then symlink to from /usr/local/bin or the like.