diff --git a/beetsplug/chroma.py b/beetsplug/chroma.py index a5585586a..a82a1898b 100644 --- a/beetsplug/chroma.py +++ b/beetsplug/chroma.py @@ -214,8 +214,10 @@ def submit_items(userkey, items, chunksize=64): )) try: _, fp = acoustid.fingerprint_file(item.path) - except acoustid.FingerprintGenerationError: - log.info('fingerprint generation failed') + except acoustid.FingerprintGenerationError as exc: + log.info( + 'fingerprint generation failed: {0}'.format(exc) + ) continue # Construct a submission dictionary for this item. @@ -244,4 +246,5 @@ def submit_items(userkey, items, chunksize=64): submit_chunk() # Submit remaining data in a final chunk. - submit_chunk() + if data: + submit_chunk() diff --git a/docs/changelog.rst b/docs/changelog.rst index 0a3fd385c..0666c9c69 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -20,6 +20,8 @@ Changelog after adding files to the library but before finishing copying them; during the next import, the (external) files would be moved instead of copied. * Fix ID3 tag name for the catalog number field. +* :doc:`/plugins/chroma`: Fix occasional crash at end of fingerprint submission + and give more context to "failed fingerprint generation" errors. 1.0b14 (May 12, 2012) --------------------- diff --git a/docs/plugins/chroma.rst b/docs/plugins/chroma.rst index 9733b4160..6fc38634b 100644 --- a/docs/plugins/chroma.rst +++ b/docs/plugins/chroma.rst @@ -29,10 +29,13 @@ To get fingerprinting working, you'll need to install three things: the First, you will need to install `Chromaprint`_, either as a dynamic library or in the form of a command-line tool (``fpcalc``). The Chromaprint site has links -to packages for major Linux distributions. On Mac OS X and Windows, download the -appropriate binary package and place the ``fpcalc`` (or ``fpcalc.exe``) on your -shell search path (e.g., in ``/usr/local/bin`` on Mac OS X or ``C:\\Program -Files`` on Windows). +to packages for major Linux distributions. If you use `Homebrew`_ on Mac OS X, +you can install the library with ``brew install chromaprint``. Otherwise, on Mac +OS X and Windows, download the appropriate binary package and place the +``fpcalc`` (or ``fpcalc.exe``) on your shell search path (e.g., in +``/usr/local/bin`` on Mac OS X or ``C:\\Program Files`` on Windows). + +.. _Homebrew: http://mxcl.github.com/homebrew/ Next, you will need a mechanism for decoding audio files supported by the `audioread`_ library. Mac OS X has a number of decoders already built into Core