mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 08:39:17 +01:00
Add write option to bpm plugin
Add write option to bpm plugin and tidy up command function.
This commit is contained in:
parent
bf29c24a57
commit
2038a40fa2
1 changed files with 4 additions and 1 deletions
|
|
@ -54,6 +54,7 @@ class BPMPlugin(BeetsPlugin):
|
|||
self.config.add({
|
||||
u'max_strokes': 3,
|
||||
u'overwrite': True,
|
||||
u'write': False
|
||||
})
|
||||
|
||||
def commands(self):
|
||||
|
|
@ -64,7 +65,9 @@ class BPMPlugin(BeetsPlugin):
|
|||
return [cmd]
|
||||
|
||||
def command(self, lib, opts, args):
|
||||
self.get_bpm(lib.items(ui.decargs(args)))
|
||||
items = lib.items(ui.decargs(args))
|
||||
write = self.config['write'].get(bool)
|
||||
self.get_bpm(items, write)
|
||||
|
||||
def get_bpm(self, items, write=False):
|
||||
overwrite = self.config['overwrite'].get(bool)
|
||||
|
|
|
|||
Loading…
Reference in a new issue