From 2038a40fa2a8013d34166f3670ccc0b57732990a Mon Sep 17 00:00:00 2001 From: Jack Wilsdon Date: Thu, 5 May 2016 11:27:28 +0100 Subject: [PATCH] Add write option to bpm plugin Add write option to bpm plugin and tidy up command function. --- beetsplug/bpm.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/beetsplug/bpm.py b/beetsplug/bpm.py index ba284c042..4e7b202ac 100644 --- a/beetsplug/bpm.py +++ b/beetsplug/bpm.py @@ -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)