Fix:Refreshing server media progress after local sync

This commit is contained in:
advplyr
2023-01-28 14:20:00 -06:00
parent 8bab4ae383
commit 860c7aac80
5 changed files with 35 additions and 16 deletions
+9 -2
View File
@@ -45,7 +45,14 @@ export default {
networkConnected(newVal) {
// Update shelves when network connect status changes
console.log(`Network changed to ${newVal} - fetch categories`)
this.fetchCategories()
if (newVal) {
setTimeout(() => {
this.fetchCategories()
}, 4000)
} else {
this.fetchCategories()
}
}
},
computed: {
@@ -123,7 +130,7 @@ export default {
this.localLibraryItems = await this.$db.getLocalLibraryItems()
const localCategories = await this.getLocalMediaItemCategories()
if (this.user && this.currentLibraryId) {
if (this.user && this.currentLibraryId && this.networkConnected) {
const categories = await this.$axios.$get(`/api/libraries/${this.currentLibraryId}/personalized?minified=1`).catch((error) => {
console.error('Failed to fetch categories', error)
return []