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

First implementation for selective modify #1838

Closed
wants to merge 6 commits into from

Conversation

pkess
Copy link
Contributor

@pkess pkess commented Jan 27, 2016

see #1723

@pkess
Copy link
Contributor Author

pkess commented Jan 27, 2016

Please do not merge this branch at the moment. It is just a preview. I want to add some tests before merging it
But please feel free to comment this approach

@pkess
Copy link
Contributor Author

pkess commented Jan 27, 2016

ok, coverage of the modify option is now nearly 100%. Except from one line with a KeyError exception.

Are we ok to merge this?

@sampsyo
Copy link
Member

sampsyo commented Jan 27, 2016

Aha, I think I understand what's going on here---the command now interactively asks you to say "yes" or "no" to each matching object. Is that right?

If so, I'd love to pause and consider the best way to do this. It seems like the need for a "selective" mode is not necessarily unique to the modify command---a similar kind of interactive selection would apply just as well to move or convert or embedart. We should consider whether we can add something to beets' general query system so this kind of thing works "automatically" for all commands.

Of course, that might be more trouble than it's worth, in which case this specific feature looks OK. We'll need to add to the documentation (and the changelog) before merging in any case.

@@ -1364,6 +1368,16 @@ def modify_items(lib, mods, dels, query, write, move, album, confirm):
obj.try_sync(write, move)


def print_modify_item(obj, mods, dels):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new function needs a docstring.

@sampsyo
Copy link
Member

sampsyo commented Jan 27, 2016

Also: thanks for expanding the tests! ✨ This coverage is awesome.

@pkess
Copy link
Contributor Author

pkess commented Jan 27, 2016

Hi,

you are right: this feature might be interesting for other commands also. But i don't know how to implement this in a clean way. Let me think about it a bit. I will give a shout if i have any ideas.

If it turns out that it is not that easy, i will cherry pick the commits to improve coverage tomorrow.

@pkess
Copy link
Contributor Author

pkess commented Feb 3, 2016

I am closing this PR now because #1843 will implement this feature in a better way

@pkess pkess closed this Feb 3, 2016
@pkess pkess deleted the selective_modify branch February 3, 2016 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants