From 4f83b2d8a6f3c5c0dacbd269d96cc2a41d5ba3c6 Mon Sep 17 00:00:00 2001 From: Julien Cassette Date: Sat, 20 Nov 2021 18:07:21 +0100 Subject: [PATCH 1/3] Add the item fields bitrate_mode, encoder_info and encoder_settings --- beets/library.py | 3 +++ docs/changelog.rst | 2 ++ docs/reference/pathformat.rst | 3 +++ setup.py | 2 +- 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/beets/library.py b/beets/library.py index a56575a52..c8993f85b 100644 --- a/beets/library.py +++ b/beets/library.py @@ -531,6 +531,9 @@ class Item(LibModel): 'length': DurationType(), 'bitrate': types.ScaledInt(1000, 'kbps'), + 'bitrate_mode': types.STRING, + 'encoder_info': types.STRING, + 'encoder_settings': types.STRING, 'format': types.STRING, 'samplerate': types.ScaledInt(1000, 'kHz'), 'bitdepth': types.INTEGER, diff --git a/docs/changelog.rst b/docs/changelog.rst index 4d27107ab..49ed43b93 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -10,6 +10,7 @@ New features: * :doc:`/plugins/kodiupdate`: Now supports multiple kodi instances :bug:`4101` +* Add the item fields ``bitrate_mode``, ``encoder_info`` and ``encoder_settings``. Bug fixes: @@ -28,6 +29,7 @@ For packagers: * We fixed a version for the dependency on the `Confuse`_ library. :bug:`4167` +* The minimum required version of :pypi:`mediafile` is now 0.9.0. 1.6.0 (November 27, 2021) diff --git a/docs/reference/pathformat.rst b/docs/reference/pathformat.rst index 9213cae4b..8f27027ac 100644 --- a/docs/reference/pathformat.rst +++ b/docs/reference/pathformat.rst @@ -235,6 +235,9 @@ Audio information: * length (in seconds) * bitrate (in kilobits per second, with units: e.g., "192kbps") +* bitrate_mode (eg. "CBR", "VBR" or "ABR", only available for the MP3 format) +* encoder_info (eg. "LAME 3.97.0", only available for some formats) +* encoder_settings (eg. "-V2", only available for the MP3 format) * format (e.g., "MP3" or "FLAC") * channels * bitdepth (only available for some formats) diff --git a/setup.py b/setup.py index fa92448a2..4c4f7d629 100755 --- a/setup.py +++ b/setup.py @@ -88,7 +88,7 @@ setup( 'unidecode', 'musicbrainzngs>=0.4', 'pyyaml', - 'mediafile>=0.2.0', + 'mediafile>=0.9.0', 'confuse>=1.5.0', 'munkres>=1.0.0', 'jellyfish', From 3b9382d8084408d8d344e30b062d51871b910dcc Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Sat, 18 Dec 2021 13:39:12 -0800 Subject: [PATCH 2/3] Syntax fix: e.g. --- docs/reference/pathformat.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/reference/pathformat.rst b/docs/reference/pathformat.rst index 8f27027ac..f6f2e06cc 100644 --- a/docs/reference/pathformat.rst +++ b/docs/reference/pathformat.rst @@ -235,9 +235,9 @@ Audio information: * length (in seconds) * bitrate (in kilobits per second, with units: e.g., "192kbps") -* bitrate_mode (eg. "CBR", "VBR" or "ABR", only available for the MP3 format) -* encoder_info (eg. "LAME 3.97.0", only available for some formats) -* encoder_settings (eg. "-V2", only available for the MP3 format) +* bitrate_mode (e.g., "CBR", "VBR" or "ABR", only available for the MP3 format) +* encoder_info (e.g., "LAME 3.97.0", only available for some formats) +* encoder_settings (e.g., "-V2", only available for the MP3 format) * format (e.g., "MP3" or "FLAC") * channels * bitdepth (only available for some formats) From fd761cb1e6c3d0f4d9c52495c7ff7f7bc13498a4 Mon Sep 17 00:00:00 2001 From: Dominik Schrempf Date: Sat, 18 Dec 2021 16:21:25 +0100 Subject: [PATCH 3/3] fix spotify pagination Basically, keep fetching tracks until there are no more available for the specified album. Fixes #4180. --- beetsplug/spotify.py | 9 ++++++++- docs/changelog.rst | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/beetsplug/spotify.py b/beetsplug/spotify.py index 2529160dd..931078d28 100644 --- a/beetsplug/spotify.py +++ b/beetsplug/spotify.py @@ -194,9 +194,16 @@ class SpotifyPlugin(MetadataSourcePlugin, BeetsPlugin): ) ) + tracks_data = album_data['tracks'] + tracks_items = tracks_data['items'] + while tracks_data['next']: + tracks_data = self._handle_response(requests.get, + tracks_data['next']) + tracks_items.extend(tracks_data['items']) + tracks = [] medium_totals = collections.defaultdict(int) - for i, track_data in enumerate(album_data['tracks']['items'], start=1): + for i, track_data in enumerate(tracks_items, start=1): track = self._get_track(track_data) track.index = i medium_totals[track.medium] += 1 diff --git a/docs/changelog.rst b/docs/changelog.rst index 4d27107ab..3283fc712 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -13,6 +13,8 @@ New features: Bug fixes: +* :doc:`/plugins/spotify`: Fix auto tagger pagination issues (fetch beyond the + first 50 tracks of a release). * :doc:`/plugins/lyrics`: Fix Genius search by using query params instead of body. * :doc:`/plugins/unimported`: The new ``ignore_subdirectories`` configuration option added in 1.6.0 now has a default value if it hasn't been set.