Add:Android device setting to adjust shake sensitivity for sleep timer #260

This commit is contained in:
advplyr
2023-01-28 17:31:52 -06:00
parent f06afbd08c
commit 28e50dd461
9 changed files with 115 additions and 70 deletions
+7 -3
View File
@@ -38,6 +38,7 @@ export default {
return {
shelves: [],
loading: false,
lastServerFetch: 0,
localLibraryItems: []
}
},
@@ -47,9 +48,11 @@ export default {
console.log(`Network changed to ${newVal} - fetch categories`)
if (newVal) {
setTimeout(() => {
this.fetchCategories()
}, 4000)
if (!this.lastServerFetch || Date.now() - this.lastServerFetch < 4000) {
setTimeout(() => {
this.fetchCategories()
}, 4000)
}
} else {
this.fetchCategories()
}
@@ -131,6 +134,7 @@ export default {
const localCategories = await this.getLocalMediaItemCategories()
if (this.user && this.currentLibraryId && this.networkConnected) {
this.lastServerFetch = Date.now()
const categories = await this.$axios.$get(`/api/libraries/${this.currentLibraryId}/personalized?minified=1`).catch((error) => {
console.error('Failed to fetch categories', error)
return []