I found some time ago (thanks to a dent on identi.ca that I don’t find at the moment, but if I’ll find it, I’ll update this post with the direct link) this little piece of Python called beets.
What is this guy? It’s simply (but not only) a music collection organizer for obsessive-compulsive music geeks that does a very large amount of work in a beautiful automatic way, and it does it GOOD.
After installing it via aptitude install beets, I created a configuration file called ~/.beetsconfig with these lines in it:
[beets]
directory: /mnt/BigBoy/Music
library: ~/.musiclibrary.blb
[paths]
default: $albumartist/$year - $album/$track - $title
singleton: Non-Album/$artist/$title
comp: Compilations/$album/$track - $title
directory is where the cleaned && tagged && fixed files will go,
library is the SQLite file containing all the metadata (that can be later on queried by beets himself, and this is another good feature of beets), and the
[paths] section holds the patterns I like for the directory structure of my music collection.
After that, let’s assume that I just bought a CD by a fictitious rockstar called “Rockstar”, and the album is called “New Album”. I rip it by using A Better CD Encoder (abcde) (maybe it will be subject of a post, sometimes), and I obtain a bunch of mp3/ogg/flac/whatever I like. Let’s assume also that the ID3V{1,2} tags aren’t really correct (even though abcde can tag the files in the right way, but I digress, sorry..).
I just have to tell beets where to find the directory containing these new files, and it’ll do what it has to:
$ beets import ~/abcde_ripped_music/RockStar-NewAlbum
What beets will do is to search (by using filenames and/or already tagged metadata) in the MusicBrainz database and when it finds the right entries, it’ll correct the tags and the filenames, it’ll add the metadata in the library SQLite database, and it’ll copy the files from the source to the destination directory, beautifully renamed like I want.
If something goes wrong (for example if beets is in doubt which entry is correct) it stops and asks the user some hint. And the user can manually search for the right entry, or can skip the album, or can add it to the library as it is without modifications, and so on.
After that I can make things like beets ls some_value_to_search_for to have the listing of my library, or by searching ID3 tags, I can maintain my database up to date by adding/removing/modifying entries, I can obtain the actual filename of some songs/albums, for example to fed them to a pipe in a shell script, I can play music with a client that uses the MPD protocol, or with a web interface from an HTML5-enabled browser, I can make statistics with beets stats, and the list of possibilities can be very long…
beets has tons and tons of options to be given in the commandline and in the configuration file (I suggest you to read the documentation and experiment a lot).
I hope that some of you will start using this little gem in the Free Software world.
P.S.: And I’ll appreciate and welcome any comment by beets users, with tricks and/or configuration advices!