beets icon indicating copy to clipboard operation
beets copied to clipboard

Remove art when removing duplicate album

Open gdetrez opened this issue 8 years ago • 4 comments

When importing a higher quality version of an album already in my library, beet offered to remove the old version, which is very handy. But it left behind the old album's directory with the cover file in it. I would have expected beet to remove it completely.

gdetrez avatar Jun 22 '16 12:06 gdetrez

Good point; we should fix this.

For anyone interested in tackling this: the problem arises in remove_duplicates and duplicate_items in beets.importer. These only work at the Item level; in album mode, they should be able to remove entire Albums.

sampsyo avatar Jun 22 '16 17:06 sampsyo

Would calling util.prune_dirs in remove_duplicates with clutter=<some reasonable list of generic cover names> as an additional argument be considered a robust enough solution or do we want to actually examine the item tags in order to find the cover they point to before deleting to?

A middle ground would be to use config to add cover names to a clutter list.

nathdwek avatar Aug 26 '16 20:08 nathdwek

Well, the beets database already keeps track of the image filenames associated with each album, so it should be even easier to remove the right files directly. It's just a matter of setting up so we can call album.remove() instead of item.remove() on the individual tracks.

sampsyo avatar Aug 26 '16 23:08 sampsyo

I was just about to post an issue about this.

I was very confused to discover many cover.{1,2,3 etc}.jpg files when review the filesystem for my collection, and it took me hours to figure out that this is what had caused it.

When I reimport an album, I have it set in the config to replace existing files, I assumed that would have referred to cover.jpg as well.

Is there any update about this? Or has an option slipped in that I missed?

sdfg2 avatar Sep 14 '22 19:09 sdfg2