beets
beets copied to clipboard
Empty directories are sometimes left behind
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
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.
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.
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:
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.
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!