Skip to content

Commit

Permalink
add playlist owner as author for Spotify playlist autocomplete (#119)
Browse files Browse the repository at this point in the history
* add playlist owner as author for Spotify playlist autocomplete

* add playlist owner as author for Deezer and AppleMusic playlist autocomplete

* Update main/src/main/java/com/github/topi314/lavasrc/deezer/DeezerAudioSourceManager.java

---------

Co-authored-by: Toπ <git@topi.wtf>
  • Loading branch information
bachtran02 and topi314 committed Sep 24, 2023
1 parent fa226eb commit b87fdc8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,8 @@ public AudioSearchResult getSearchSuggestions(String query, Set<AudioSearchResul
var name = attributes.get("name").text();
var artworkUrl = parseArtworkUrl(attributes.get("artwork"));
var trackCount = (int) attributes.get("trackCount").asLong(0);
var playlist = new AppleMusicAudioPlaylist(name, Collections.emptyList(), ExtendedAudioPlaylist.Type.PLAYLIST, url, artworkUrl, null, trackCount);
var author = attributes.get("data").index(0).get("attributes").get("curatorName").text();
var playlist = new AppleMusicAudioPlaylist(name, Collections.emptyList(), ExtendedAudioPlaylist.Type.PLAYLIST, url, artworkUrl, author, trackCount);
playLists.add(playlist);
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ private AudioSearchResult getAutocomplete(String query, Set<AudioSearchResult.Ty
DeezerAudioPlaylist.Type.PLAYLIST,
playlist.get("link").text(),
playlist.get("picture_xl").text(),
null,
playlist.get("creator").get("name").text(),
(int) playlist.get("nb_tracks").asLong(0)
));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ private AudioSearchResult getAutocomplete(String query, Set<AudioSearchResult.Ty
ExtendedAudioPlaylist.Type.PLAYLIST,
playlist.get("external_urls").get("spotify").text(),
playlist.get("images").index(0).get("url").text(),
null,
playlist.get("owner").get("display_name").text(),
(int) playlist.get("tracks").get("total").asLong(0)
));
}
Expand Down

0 comments on commit b87fdc8

Please sign in to comment.