opn: update user's playlists

This commit is contained in:
2024-07-28 01:20:10 +05:30
parent 6c497c9be1
commit 7074009fab
8 changed files with 253 additions and 5 deletions

View File

@@ -130,9 +130,11 @@ const getPlaylistDetails = async (req, res) => {
// previous fields get carried over to the next URL, but most of these fields are not present in the new endpoint
// API shouldn't be returning such URLs, the problem's in the API ig...
playlist.next = new URL(response.data.tracks.next);
playlist.next.searchParams.set("fields", mainFields.join());
playlist.next = playlist.next.href;
if (response.data.tracks.next) {
playlist.next = new URL(response.data.tracks.next);
playlist.next.searchParams.set("fields", mainFields.join());
playlist.next = playlist.next.href;
}
playlist.tracks = response.data.tracks.items.map((playlist_item) => {
return {
is_local: playlist_item.is_local,