Moving Music

Bandcamp has secured its spot as one of my all-time top five favorite sites on the internet. When the coronavirus quarantined us all into a world bereft of concerts, they started what’s come to be called Bandcamp Days—Fridays on which they waive their share of sales, so the artists receive 100%. There have been a few now. Labels hold special deals, artists prepare special releases. It’s become a thing.

And, to stand with the anti-police violence, anti-racism movement currently gripping the country—nevermind the tragedy that we even need an anti-police violence, anti-racism movement right now—they announced they’d be donating their share of sales last Friday, Juneteenth, to the NAACP Legal Defense Fund.

So I’ve been buying a lot of music on Bandcamp recently.

But this creates an issue. How do you add 50 new albums into your music library without dying of tedium? When I pitched the problem and my solution to my wife, she said “Drag and drop…?” That doesn’t work for me. ncmpcpp doesn’t support drag-and-drop.

no drag-and-drop for ncmpcpp

So I wrote a little command line tool to import albums to your library. It’s very simple and currently only supports zip or single files named in the format Bandcamp creates—like {artist} - {album}.zip or {artist} - {song}.mp3—but it handles the work of unzipping the album, creating the appropriate directories—like ~/Music/{artist}/{album}—and renaming the album’s files appropriately—by stripping the artist and album names—so the result looks like:

$ tree "~/Music/Robert Aiki Aubrey Lowe/Mind Kontrol"
/home/rfm/Music/Robert Aiki Aubrey Lowe/Mind Kontrol
├── 01 Pavla Vlasova vs. Institute of Paranormal Studies.mp3
├── 02 Stixus.mp3
├── 03 Four Into Three (4 – 3).mp3
├── 04 Rex-L-4.mp3
├── 05 Glissade.mp3
└── cover.jpg

If the file names contain weird character conversions (like question marks converted to hyphens), or if you’d like a manual override for any reason, you can run it interactively and confirm values and actions before they’re made.

After importing the files, the next step of course is to tag those files. And of course you’d use a separate tool for that.