artist feed will now sort by date correctly, removed some console alerts
This commit is contained in:
parent
7a19de11f7
commit
0da3ad6b1d
2 changed files with 13 additions and 7 deletions
|
@ -54,6 +54,12 @@
|
|||
self.artistFeed.push(item.views["latest-release"].data[0])
|
||||
}
|
||||
})
|
||||
// sort artistFeed by attributes.releaseDate descending, date is formatted as "YYYY-MM-DD"
|
||||
this.artistFeed.sort((a, b) => {
|
||||
let dateA = new Date(a.attributes.releaseDate)
|
||||
let dateB = new Date(b.attributes.releaseDate)
|
||||
return dateB - dateA
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
|
|
|
@ -122,23 +122,16 @@
|
|||
playlists.push(item.id)
|
||||
}
|
||||
}
|
||||
console.warn(playlists)
|
||||
console.warn(libraryPlaylists)
|
||||
if (playlists.length != 0) {
|
||||
this.app.mk.api.playlists(playlists).then(playlistsData => {
|
||||
self.favorites.push(...playlistsData)
|
||||
console.info(playlistsData)
|
||||
})
|
||||
}
|
||||
if (libraryPlaylists.length != 0) {
|
||||
this.app.mk.api.library.playlists(libraryPlaylists).then(playlistsData => {
|
||||
self.favorites.push(...playlistsData)
|
||||
console.info(playlistsData)
|
||||
})
|
||||
}
|
||||
console.warn(this.favoriteItems)
|
||||
|
||||
console.warn(self.favorites)
|
||||
},
|
||||
async getArtistFeed() {
|
||||
let artists = this.followedArtists
|
||||
|
@ -157,7 +150,14 @@
|
|||
self.artistFeed.push(item.views["latest-release"].data[0])
|
||||
}
|
||||
})
|
||||
// sort artistFeed by attributes.releaseDate descending, date is formatted as "YYYY-MM-DD"
|
||||
this.artistFeed.sort((a, b) => {
|
||||
let dateA = new Date(a.attributes.releaseDate)
|
||||
let dateB = new Date(b.attributes.releaseDate)
|
||||
return dateB - dateA
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
},
|
||||
getRecentlyPlayed() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue