beets icon indicating copy to clipboard operation
beets copied to clipboard

Empty directories are sometimes left behind

Open ghost opened this issue 11 years ago • 5 comments

This issue was automatically migrated from Google Code. Original author: [email protected] (October 07, 2012 05:33:16) Original issue: https://github.com/google-code-export/beets/issues/445

ghost avatar Feb 28 '13 19:02 ghost

Same here. With 1.3.6 all empty directories are left behind. I don’t know if the delete option should trigger that, since it’s not documented.

Profpatsch avatar Jun 21 '14 17:06 Profpatsch

I can see scenarios where removing the top-level directory could be surprising for users e.g. a directory where you dump new files into for importing later. That directory would need to be recreated each time you wanted to add new files to it.

On the other hand, the docs don't mention this at all - they imply that all empty directories will be pruned. So you could argue the current behaviour is more confusing :)

IMO it makes more sense to prune the top level directory since it's something user has to explicitly enable by setting move = True (or deprecated/private delete config option).

Maybe the best solution would be a new setting to enable this (disabled by default, of course). Usually adding more config options is not desirable but if this change would be confusing to existing users it seems like the only simple solution.

djl avatar Dec 14 '14 17:12 djl

Good point about the docs; I've added a note.

Yes, a config option may be the only way here. That's what I was trying to avoid (it's such a hyper-specific behavior with potentially difficult-to-explain meaning), but I clearly haven't come up with any better ideas. :smiley:

sampsyo avatar Dec 15 '14 04:12 sampsyo

I do no think adding a option — off by default — to always remove empty top-level directories after importing is that confusing, nor too difficult to explain.

Currently, the docs on clutter state:

The importer only removes recursively searched subdirectories—the top-level directory you specify on the command line is never deleted.

If you add the option always_remove_empty_dirs, either as global option or as suboption to clutter, you could simply modify the docs to state:

By default, the importer only removes recursively searched subdirectories—the top-level directory you specify on the command line is never deleted. However, if you instead always want to remove empty delete directories after importing, set [option_name] to true.

Not sure if there would be any other caveats to having such an option, but you could always reiterate them in the docs. I understand that option bloat is a concern, but then again, the amount of options beets currently understands is probably already close to 100.

Thanks for the cool utility btw :) The current behavior of clutter is currently my only little annoyance.

rien333 avatar Dec 22 '23 18:12 rien333

Sure; it could definitely work! I'd suggest a name like remove_top_dir or similar, to convey exactly what it changes. But I don't object to such a config option!

sampsyo avatar Dec 23 '23 00:12 sampsyo