mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 08:39:17 +01:00
autobpm: Fix the issue with tempo being a numpy array
This commit is contained in:
parent
03cf567a90
commit
49cae5ca23
4 changed files with 9 additions and 6 deletions
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
2
poetry.lock
generated
2
poetry.lock
generated
|
|
@ -3188,4 +3188,4 @@ web = ["flask", "flask-cors"]
|
|||
[metadata]
|
||||
lock-version = "2.0"
|
||||
python-versions = ">=3.8,<4"
|
||||
content-hash = "f0fd6d00bf9a47f06a49863ba4675d393a4b392feec38dd83c1064c98381eb31"
|
||||
content-hash = "863a8a4fb3e20fe6688394c02614f7c296d239e7d7ecfb4af04926a92de7610c"
|
||||
|
|
|
|||
|
|
@ -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 }
|
||||
|
|
|
|||
Loading…
Reference in a new issue