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

Add write option to bpm plugin #1992

Merged
merged 6 commits into from
Jan 2, 2017
Merged

Conversation

jackwilsdon
Copy link
Member

Add write option to bpm plugin and tidy up command function.

It looks like a write option was going to be implemented but never ended up being added? The reason I think this is that there's an unused write argument for get_bpm that writes the item after the BPM is updated.

See #1991 and #1991 (comment) for more information.

@sampsyo
Copy link
Member

sampsyo commented May 6, 2016

Good idea; thanks!

We actually have some generic machinery for this kind of thing in the form of the beets.ui.should_write() function. The idea is that the import.write option serves as a default, but plugins can override with their own one-off write option too. Here's an example in the mbsync function:

write = ui.should_write(opts.write)

Can we use that so users like @jfunction get what they expect the first time around?

@jackwilsdon
Copy link
Member Author

So should I remove the bpm.write configuration value? Or should I pass it's value to should_write so it can be set either in bpm.write or import.write?

@sampsyo
Copy link
Member

sampsyo commented May 6, 2016

Probably the most straightforward way would be to remove that option, yes. If you like, we could also add a command-line override flag like mbsync has.

@Kraymer
Copy link
Contributor

Kraymer commented Dec 30, 2016

lgtm

@sampsyo
Copy link
Member

sampsyo commented Dec 31, 2016

Hey! @Kraymer's comment reminded me that this was still open. Sorry for letting this slip through the cracks! It looks like this is 100% ready to go (modulo moving the changelog entry)?

@sampsyo sampsyo merged commit 9c2c331 into beetbox:master Jan 2, 2017
sampsyo added a commit that referenced this pull request Jan 2, 2017
sampsyo added a commit that referenced this pull request Jan 2, 2017
@sampsyo
Copy link
Member

sampsyo commented Jan 2, 2017

Merged with changelog entry moved! ✨ Many belated thanks, @jackwilsdon.

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.

3 participants