Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty directories are sometimes left behind #130

Open
ghost opened this issue Feb 28, 2013 · 5 comments
Open

Empty directories are sometimes left behind #130

ghost opened this issue Feb 28, 2013 · 5 comments
Labels
bug bugs that are confirmed and actionable migrated Issue migrated from Google Code

Comments

@ghost
Copy link

ghost commented Feb 28, 2013

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

@Profpatsch
Copy link
Member

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.

@djl
Copy link
Member

djl commented Dec 14, 2014

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.

sampsyo added a commit that referenced this issue Dec 15, 2014
@sampsyo
Copy link
Member

sampsyo commented Dec 15, 2014

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. 😃

@rien333
Copy link

rien333 commented Dec 22, 2023

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.

@sampsyo
Copy link
Member

sampsyo commented Dec 23, 2023

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs that are confirmed and actionable migrated Issue migrated from Google Code
Projects
None yet
Development

No branches or pull requests

4 participants