Skip to content

Commit

Permalink
Fix Deezer only loading first 25 tracks from albums
Browse files Browse the repository at this point in the history
Also fetch ISRCs when using albums
  • Loading branch information
freyacodes committed Apr 18, 2024
1 parent a7dfa29 commit 52cef0b
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,19 @@ private AudioItem getAlbum(String id, boolean preview) throws IOException {
var artworkUrl = json.get("cover_xl").text();
var author = json.get("contributors").values().get(0).get("name").text();

for (var track : json.get("tracks").get("data").values()) {
var tracks = this.getJson(PUBLIC_API_BASE + "/album/" + id + "/tracks?limit=10000");

for (var track : tracks.get("data").values()) {
track.get("artist").put("picture_xl", json.get("artist").get("picture_xl"));
}

return new DeezerAudioPlaylist(json.get("title").text(), this.parseTracks(json.get("tracks"), preview), DeezerAudioPlaylist.Type.ALBUM, json.get("link").text(), artworkUrl, author, (int) json.get("nb_tracks").asLong(0));
return new DeezerAudioPlaylist(json.get("title").text(),
this.parseTracks(tracks, preview),
DeezerAudioPlaylist.Type.ALBUM,
json.get("link").text(),
artworkUrl,
author,
(int) json.get("nb_tracks").asLong(0));
}

private AudioItem getTrack(String id, boolean preview) throws IOException {
Expand Down

0 comments on commit 52cef0b

Please sign in to comment.