Merge pull request #4200 from dschrempf/deezer-paginate

This commit is contained in:
Adrian Sampson 2021-12-19 16:46:44 -08:00 committed by GitHub
commit bcf0728248
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View file

@ -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):

View file

@ -14,6 +14,8 @@ New features:
Bug fixes:
* :doc:`/plugins/deezer`: Fix auto tagger pagination issues (fetch beyond the
first 25 tracks of a release).
* :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.