Fixes for chroma.auto (#888, fix #629)

This commit is contained in:
Adrian Sampson 2014-07-25 21:28:52 -07:00
parent 4df38c8b86
commit 51123d901b
3 changed files with 22 additions and 11 deletions

View file

@ -114,6 +114,16 @@ def _all_releases(items):
class AcoustidPlugin(plugins.BeetsPlugin):
def __init__(self):
super(AcoustidPlugin, self).__init__()
self.config.add({
'auto': True,
})
if self.config['auto']:
self.register_listener('import_task_start', fingerprint_task)
def track_distance(self, item, info):
dist = hooks.Distance()
if item.path not in _matches or not info.track_id:
@ -176,16 +186,13 @@ class AcoustidPlugin(plugins.BeetsPlugin):
# Hooks into import process.
@AcoustidPlugin.listen('import_task_start')
def fingerprint_task(task, session):
"""Fingerprint each item in the task for later use during the
autotagging candidate search.
"""
auto = config['acoustid']['auto']
if auto:
items = task.items if task.is_album else [task.item]
for item in items:
acoustid_match(item.path)
items = task.items if task.is_album else [task.item]
for item in items:
acoustid_match(item.path)
@AcoustidPlugin.listen('import_task_apply')

View file

@ -65,6 +65,8 @@ Little improvements and fixes:
has been improved. Thanks to sotho.
* Already imported singleton tracks are skipped when resuming an
import.
* :doc:`/plugins/chroma`: A new ``auto`` configuration option disables
fingerprinting on import. Thanks to ddettrittus.
1.3.6 (May 10, 2014)

View file

@ -93,11 +93,7 @@ Using
Once you have all the dependencies sorted out, you can enable fingerprinting by
editing your :doc:`configuration file </reference/config>`. Put ``chroma`` on
your ``plugins:`` line. With that, beets will use fingerprinting the next time
you run ``beet import``. This can be disabled by setting the ``auto`` option to
false, like so::
acoustid:
auto: no
you run ``beet import``.
You can also use the ``beet fingerprint`` command to generate fingerprints for
items already in your library. (Provide a query to fingerprint a subset of your
@ -105,6 +101,12 @@ library.) The generated fingerprints will be stored in the library database.
If you have the ``import.write`` config option enabled, they will also be
written to files' metadata.
You can disable fingerprinting on import by setting the ``auto`` option to
false, like so::
chroma:
auto: no
.. _submitfp:
Submitting Fingerprints