Moved library-songs to EJS, added check for empty library

This commit is contained in:
booploops 2021-12-06 18:39:31 -08:00
parent 0a6f5a78d8
commit 9fccd97d71
3 changed files with 23 additions and 17 deletions

View file

@ -82,7 +82,7 @@ const app = new Vue({
meta: {total: 0, progress: 0},
search: "",
displayListing: [],
downloadState: 0 // 0 = not started, 1 = in progress, 2 = complete
downloadState: 0 // 0 = not started, 1 = in progress, 2 = complete, 3 = empty library
},
albums: {
listing: [],
@ -323,6 +323,10 @@ const app = new Vue({
library = library.concat(downloaded.data)
self.library.songs.meta.total = downloaded.meta.total
self.library.songs.meta.progress = library.length
if(downloaded.meta.total == 0) {
self.library.songs.downloadState = 3
return
}
if(typeof downloaded.next == "undefined") {
console.log("downloaded.next is undefined")
self.library.songs.listing = library