Clean up library folders without moving?

I recently went through the effort of importing ~30k tracks into management with beets. Everything went fairly well aside from a few issues with missing files, etc. The one decision I made is that I didn’t want any duplicate albums on this first import. If, down the road, I decide to add a specific version of an album I can re-add that later. As such I was replacing a lot of albums during the import. One example is ‘Pink Floyd - The Wall’ since there are about 200 versions of that album :).

So what happened is that I now have quite a few folders with one file in them. Typically the file is ‘albumart’. Previously while organizing my library with another manager, it would move non-audio files with the music files. This was nice to preserve scans or whatever, but also nice because it’s really easy to find and delete empty directories.

Obviously I could probably write a script to find all folders with only 1 file in them and manually delete, or even search for albumart as the only file, etc. However, is it possible with beets to remove all folders in the library directory that are not managed by beets?

My other thought is that I could use beets to move my library from /Albums to /Albums1 and then delete everything in /Albums and move it back. Any concerns before I go down this path?

There is nothing that specifically does this:

But you’re right; just doing a beet move to a new directory and then beet moveing the files back should work great!

Some other things to be aware of:

  • Use the fetchart plugin to pick up image files alongside music files.
  • Use the clutter option to configure how beets automatically deletes non-music files in otherwise-empty directories.
  • See the third-party extrafiles plugin for moving arbitrary files alongside music.
1 Like

Thanks for the hints. I’ll read up on these plugins/options and give my library a refresh today.

Quick question on the move. I have my music library mounted at /music which is actually /mnt/music/Library/Albums. If I change the mount point of /music to be /mnt/music/Library and then update my directory setting to /music/Albums that will probably screw up the whole database, right?

I think my best step here is to just use the logical paths for moving and not messing with the library/directory setting.

Nevermind. I set the mount point wrong and messed up my library so I’m just going an import in the new location.

OK, sounds good. FYI, there is an FAQ about relocating your library.

Yeah, I’m using that. I realized after asking my question that it’s very specific to my situation and doesn’t really apply to beets. I was trying to determine what it would do if I changed the mount point of my music under beets’ config for the directory. I’m just doing this the long way now since it’s the most straight forward.