Skip to content

Commit

Permalink
Fix not parsing full Deezer playlists
Browse files Browse the repository at this point in the history
  • Loading branch information
freyacodes committed Apr 16, 2024
1 parent 32b7986 commit 4db1f54
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,16 @@ private AudioItem getPlaylist(String id, boolean preview) throws IOException {
var artworkUrl = json.get("picture_xl").text();
var author = json.get("creator").get("name").text();

var tracks = this.getJson(PUBLIC_API_BASE + "/playlist/" + id + "/tracks");

return new DeezerAudioPlaylist(json.get("title").text(), this.parseTracks(tracks, preview), DeezerAudioPlaylist.Type.PLAYLIST, json.get("link").text(), artworkUrl, author, (int) json.get("nb_tracks").asLong(0));
// This endpoint returns tracks with ISRC, unlike the other REST call
var tracks = this.getJson(PUBLIC_API_BASE + "/playlist/" + id + "/tracks?limit=10000");

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

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

0 comments on commit 4db1f54

Please sign in to comment.