Organizing and Cleaning Up Music Collection with Beets

Feb 14, 24

I stumbled upon Beets, a powerful piece of command-line software that helps to organize and clean up music files. I have quite a lot of music files I’ve gathered over the years, going back to when I converted my entire CD collection to FLAC files and just tossed the CDs in the trash. Much easier to lug around.

Like I said, Beets is powerful, and it offered fine-grained control over what it does with the files, depending on how you set up its configuration file. It’s a YAML file, so the spaces have to be exactly right for it to work.

I wanted a few things. Clean up all the names, first. It pretty much does that automatically, and it will query a few different databases to get that informatin. It uses musicbrainz by default, and it will also use Spotify and Deezer if you tell it to in the config. Next, I wanted it to download and write the album art to the files, which isn’t all that important but it does look cool. And Lastly, I wanted it to organize write album names with the year trailing, like this: Abbey Road (1967).

Now, to get that to work, I spent all morning tweaking the config file and reading up on plugins on the beets web page. It was a bit of trial and error. This is the configuration I ened up using:

directory: ~/music
library: ~/music.db
plugins: fetchart embedart spotify deezer scrub the

fetchart:
auto: yes
cautious: true
cover_names: front back
sources:
    - coverart: release
    - amazon
    - itunes
    - coverart: releasegroup
    - '*'

embedart:
    auto: yes
    compare_threshold: 10

paths:
    default: %the{$albumartist}/$album ($year)/$track $title

I hope that helps someone. But yeah, it was pretty surprising how much work it did, all the errors over the years piling up.