File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 291291 }
292292
293293 async function fetchPlaylistTracks ( uri ) {
294- const res = await Spicetify . CosmosAsync . get ( `sp://core-playlist/v1/playlist/ spotify:playlist:${ uri } /rows `, {
295- policy : { link : true , playable : true } ,
294+ const res = await Spicetify . Platform . PlaylistAPI . getContents ( ` spotify:playlist:${ uri } `, {
295+ limit : 9999999 ,
296296 } ) ;
297- return res . rows . filter ( ( track ) => track . playable ) . map ( ( track ) => track . link ) ;
297+ return res . items . filter ( ( track ) => track . isPlayable ) . map ( ( track ) => track . uri ) ;
298298 }
299299
300300 function searchFolder ( rows , uri ) {
321321 if ( ! folder . rows ) return ;
322322
323323 for ( const i of folder . rows ) {
324- if ( i . type === "playlist" ) requestPlaylists . push ( await fetchPlaylistTracks ( i . link . split ( ":" ) [ 2 ] ) ) ;
325- else if ( i . type === "folder" ) await fetchNested ( i ) ;
324+ if ( i . type === "playlist" ) {
325+ const uriObj = Spicetify . URI . fromString ( i . link ) ;
326+ const uri = uriObj . _base62Id ?? uriObj . id ;
327+ requestPlaylists . push ( await fetchPlaylistTracks ( uri ) ) ;
328+ } else if ( i . type === "folder" ) await fetchNested ( i ) ;
326329 }
327330 }
328331
You can’t perform that action at this time.
0 commit comments