From 969f045610da16a0e2ce0a211d32ea11150ae63f Mon Sep 17 00:00:00 2001 From: Dominik Schrempf Date: Sun, 19 Dec 2021 00:53:39 +0100 Subject: [PATCH 1/2] fix deezer pagination See #4180, and #4198. --- beetsplug/deezer.py | 9 +++++++-- docs/changelog.rst | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/beetsplug/deezer.py b/beetsplug/deezer.py index d21b1e9ed..221673b50 100644 --- a/beetsplug/deezer.py +++ b/beetsplug/deezer.py @@ -77,11 +77,16 @@ class DeezerPlugin(MetadataSourcePlugin, BeetsPlugin): "by {} API: '{}'".format(self.data_source, release_date) ) - tracks_data = requests.get( + tracks_obj = requests.get( self.album_url + deezer_id + '/tracks' - ).json()['data'] + ).json() + tracks_data = tracks_obj['data'] if not tracks_data: return None + while "next" in tracks_obj: + tracks_obj = requests.get(tracks_obj['next']).json() + tracks_data.extend(tracks_obj['data']) + tracks = [] medium_totals = collections.defaultdict(int) for i, track_data in enumerate(tracks_data, start=1): diff --git a/docs/changelog.rst b/docs/changelog.rst index 4d27107ab..6b33e884d 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -12,7 +12,8 @@ New features: :bug:`4101` Bug fixes: - +* :doc:`/plugins/deezer`: Fix auto tagger pagination issues (fetch beyond the + first 25 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. From ba3569afa121abaa6830887824b4f2dbeb9a71b0 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Sun, 19 Dec 2021 07:31:29 -0800 Subject: [PATCH 2/2] Add a paragraph space --- docs/changelog.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index 6b33e884d..8307ff7b6 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -12,6 +12,7 @@ New features: :bug:`4101` Bug fixes: + * :doc:`/plugins/deezer`: Fix auto tagger pagination issues (fetch beyond the first 25 tracks of a release). * :doc:`/plugins/lyrics`: Fix Genius search by using query params instead of body.