Skip to content

Commit bcf0728

Browse files
authored
Merge pull request #4200 from dschrempf/deezer-paginate
2 parents fcb73ad + 17410cd commit bcf0728

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

beetsplug/deezer.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,16 @@ def album_for_id(self, album_id):
7777
"by {} API: '{}'".format(self.data_source, release_date)
7878
)
7979

80-
tracks_data = requests.get(
80+
tracks_obj = requests.get(
8181
self.album_url + deezer_id + '/tracks'
82-
).json()['data']
82+
).json()
83+
tracks_data = tracks_obj['data']
8384
if not tracks_data:
8485
return None
86+
while "next" in tracks_obj:
87+
tracks_obj = requests.get(tracks_obj['next']).json()
88+
tracks_data.extend(tracks_obj['data'])
89+
8590
tracks = []
8691
medium_totals = collections.defaultdict(int)
8792
for i, track_data in enumerate(tracks_data, start=1):

docs/changelog.rst

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ New features:
1414

1515
Bug fixes:
1616

17+
* :doc:`/plugins/deezer`: Fix auto tagger pagination issues (fetch beyond the
18+
first 25 tracks of a release).
1719
* :doc:`/plugins/spotify`: Fix auto tagger pagination issues (fetch beyond the
1820
first 50 tracks of a release).
1921
* :doc:`/plugins/lyrics`: Fix Genius search by using query params instead of body.

0 commit comments

Comments
 (0)