fix album sorting on refresh
This commit is contained in:
parent
be9cbfb9e6
commit
32cb85481d
3 changed files with 6 additions and 6 deletions
|
@ -1030,7 +1030,7 @@ const app = new Vue({
|
|||
downloadChunk()
|
||||
},
|
||||
// copy the getLibrarySongsFull function except change Songs to Albums
|
||||
async getLibraryAlbumsFull(force = false) {
|
||||
async getLibraryAlbumsFull(force = false, index) {
|
||||
let self = this
|
||||
let library = []
|
||||
let downloaded = null;
|
||||
|
@ -1039,7 +1039,7 @@ const app = new Vue({
|
|||
}
|
||||
if (localStorage.getItem("libraryAlbums") != null) {
|
||||
this.library.albums.listing = JSON.parse(localStorage.getItem("libraryAlbums"))
|
||||
this.searchLibraryAlbums()
|
||||
this.searchLibraryAlbums(index)
|
||||
}
|
||||
if (this.songstest) {
|
||||
return
|
||||
|
@ -1078,7 +1078,7 @@ const app = new Vue({
|
|||
self.library.albums.downloadState = 2
|
||||
self.library.downloadNotification.show = false
|
||||
localStorage.setItem("libraryAlbums", JSON.stringify(library))
|
||||
self.searchLibraryAlbums()
|
||||
self.searchLibraryAlbums(index)
|
||||
}
|
||||
if (downloaded.meta.total > library.length || typeof downloaded.meta.next != "undefined") {
|
||||
console.log(`downloading next chunk - ${library.length
|
||||
|
@ -1089,7 +1089,7 @@ const app = new Vue({
|
|||
self.library.albums.downloadState = 2
|
||||
self.library.downloadNotification.show = false
|
||||
localStorage.setItem("libraryAlbums", JSON.stringify(library))
|
||||
self.searchLibraryAlbums()
|
||||
self.searchLibraryAlbums(index)
|
||||
console.log(library)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<h1 class="header-text">Albums</h1>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<button v-if="library.albums.downloadState == 2" @click="getLibraryAlbumsFull(true)" class="reload-btn"><%- include('../svg/redo.svg') %></button>
|
||||
<button v-if="library.albums.downloadState == 2" @click="getLibraryAlbumsFull(true, 1)" class="reload-btn"><%- include('../svg/redo.svg') %></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
<h1 class="header-text">Recently Added</h1>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<button v-if="library.albums.downloadState == 2" @click="getLibraryAlbumsFull(true)" class="reload-btn"><%- include('../svg/redo.svg') %></button>
|
||||
<button v-if="library.albums.downloadState == 2" @click="getLibraryAlbumsFull(true, 0)" class="reload-btn"><%- include('../svg/redo.svg') %></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue