diff --git a/beetsplug/chroma.py b/beetsplug/chroma.py index f90877113..3b31382b7 100644 --- a/beetsplug/chroma.py +++ b/beetsplug/chroma.py @@ -98,7 +98,9 @@ def acoustid_match(log, path): fp = fp.decode() _fingerprints[path] = fp try: - res = acoustid.lookup(API_KEY, fp, duration, meta="recordings releases") + res = acoustid.lookup( + API_KEY, fp, duration, meta="recordings releases", timeout=10 + ) except acoustid.AcoustidError as exc: log.debug( "fingerprint matching {0} failed: {1}", @@ -292,7 +294,7 @@ def submit_items(log, userkey, items, chunksize=64): """Submit the current accumulated fingerprint data.""" log.info("submitting {0} fingerprints", len(data)) try: - acoustid.submit(API_KEY, userkey, data) + acoustid.submit(API_KEY, userkey, data, timeout=10) except acoustid.AcoustidError as exc: log.warning("acoustid submission error: {0}", exc) del data[:] diff --git a/docs/changelog.rst b/docs/changelog.rst index 00e9a9e74..52d9cd89e 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -55,6 +55,8 @@ Bug fixes: - :doc:`plugins/lastgenre`: Fix the issue introduced in Beets 2.3.0 where non-whitelisted last.fm genres were not canonicalized to parent genres. :bug:`5930` +- :doc:`plugins/chroma`: AcoustID lookup HTTP requests will now time out after + 10 seconds, rather than hanging the entire import process. For packagers: