playlist folders will now load recursively

This commit is contained in:
booploops 2022-01-03 00:58:08 -08:00
parent 1b5474a81e
commit bda22b2321
3 changed files with 40 additions and 18 deletions

View file

@ -619,15 +619,7 @@ const app = new Vue({
async refreshPlaylists() {
let self = this
this.apiCall('https://api.music.apple.com/v1/me/library/playlist-folders/p.playlistsroot/children/', res => {
console.log(res)
self.playlists.listing = res.data
self.playlists.listing.forEach(playlist => {
if(playlist.type === "library-playlist-folders") {
self.mk.api.library.playlistFolderChildren(playlist.id).then(children => {
playlist.children = children
})
}
})
self.playlists.listing.sort((a, b) => {
if (a.type === "library-playlist-folders" && b.type !== "library-playlist-folders") {
return -1