diff --git a/beetsplug/autobpm.py b/beetsplug/autobpm.py index aace0c593..fa08a12cb 100644 --- a/beetsplug/autobpm.py +++ b/beetsplug/autobpm.py @@ -11,9 +11,7 @@ # The above copyright notice and this permission notice shall be # included in all copies or substantial portions of the Software. -"""Uses Librosa to calculate the `bpm` field. -""" - +"""Uses Librosa to calculate the `bpm` field.""" from librosa import beat, load from soundfile import LibsndfileError @@ -78,7 +76,7 @@ class AutoBPMPlugin(BeetsPlugin): ) continue - tempo, _ = beat.beat_track(y=y, sr=sr) + (tempo, *_), _ = beat.beat_track(y=y, sr=sr) bpm = round(tempo) item["bpm"] = bpm self._log.info( diff --git a/docs/changelog.rst b/docs/changelog.rst index d9d79f21b..bf880dbda 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -18,6 +18,10 @@ Bug fixes: * Improved naming of temporary files by separating the random part with the file extension. * Fixed the ``auto`` value for the :ref:`reflink` config option. * Fixed lyrics plugin only getting part of the lyrics from ``Genius.com`` :bug:`4815` +* :doc:`plugins/autobpm`: Fix the ``TypeError`` where tempo was being returned + as a numpy array. Update ``librosa`` dependency constraint to prevent similar + issues in the future. + :bug:`5289` For packagers: @@ -26,6 +30,7 @@ For packagers: * The `typing_extensions` is required for Python 3.10 and below. Other changes: + * :doc:`contributing`: The project now uses `poetry` for packaging and dependency management. This change affects project management and mostly affects beets developers. Please see updates in :ref:`getting-the-source` and diff --git a/poetry.lock b/poetry.lock index 2cfb70041..b8eaaf428 100644 --- a/poetry.lock +++ b/poetry.lock @@ -3188,4 +3188,4 @@ web = ["flask", "flask-cors"] [metadata] lock-version = "2.0" python-versions = ">=3.8,<4" -content-hash = "f0fd6d00bf9a47f06a49863ba4675d393a4b392feec38dd83c1064c98381eb31" +content-hash = "863a8a4fb3e20fe6688394c02614f7c296d239e7d7ecfb4af04926a92de7610c" diff --git a/pyproject.toml b/pyproject.toml index 97b25356d..6e7ed7a90 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,7 +48,7 @@ dbus-python = { version = "*", optional = true } flask = { version = "*", optional = true } flask-cors = { version = "*", optional = true } langdetect = { version = "*", optional = true } -librosa = { version = ">=0.10.2.post1", optional = true } +librosa = { version = "^0.10.2.post1", optional = true } mutagen = { version = ">=1.33", optional = true } Pillow = { version = "*", optional = true } py7zr = { version = "*", optional = true }