Merge pull request #1992 from jackwilsdon/add-write-bpm

Add write option to bpm plugin
This commit is contained in:
Adrian Sampson 2017-01-01 23:09:41 -05:00
commit f621d7f4f1
4 changed files with 22 additions and 1 deletions

View file

@ -65,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 = ui.should_write()
self.get_bpm(items, write)
def get_bpm(self, items, write=False):
overwrite = self.config['overwrite'].get(bool)

View file

@ -22,6 +22,8 @@ Features:
for files that already have it by default. You can override this behavior
using a new ``force`` option. Thanks to :user:`SusannaMaria`. :bug:`2347`
:bug:`2349`
* :doc:`/plugins/bpm`: Now uses ``import.write`` option to write tracks after
updating their BPM.
Fixes:

View file

@ -22,6 +22,21 @@ for instance, with ``mpc`` you can do something like::
beet bpm $(mpc |head -1|tr -d "-")
If :ref:`import.write <config-import-write>` is ``yes``, the song's tags are
written to disk.
Configuration
-------------
To configure the plugin, make a ``bpm:`` section in your configuration file.
The available options are:
- **max_strokes**: The maximum number of strokes to accept when tapping out the
BPM.
Default: 3.
- **overwrite**: Overwrite the track's existing BPM.
Default: ``yes``.
Credit
------

View file

@ -387,6 +387,8 @@ file that looks like this::
These options are available in this section:
.. _config-import-write:
write
~~~~~