Add keep local media progress and playback sessions, update data models to support syncing local progress and support for podcast episodes

This commit is contained in:
advplyr
2022-04-09 12:03:37 -05:00
parent 526fca98b9
commit d9e4469089
23 changed files with 295 additions and 118 deletions
+17 -11
View File
@@ -164,6 +164,7 @@ export default {
return this.$store.getters['user/getToken']
},
userItemProgress() {
if (this.isLocal) return this.$store.getters['globals/getLocalMediaProgressById'](this.libraryItemId)
return this.$store.getters['user/getUserMediaProgress'](this.libraryItemId)
},
userIsFinished() {
@@ -238,17 +239,22 @@ export default {
})
if (value) {
this.resettingProgress = true
this.$axios
.$delete(`/api/me/progress/${this.libraryItemId}`)
.then(() => {
console.log('Progress reset complete')
this.$toast.success(`Your progress was reset`)
this.resettingProgress = false
})
.catch((error) => {
console.error('Progress reset failed', error)
this.resettingProgress = false
})
if (this.isLocal) {
await this.$db.removeLocalMediaProgress(this.libraryItemId)
this.$store.commit('globals/removeLocalMediaProgress', this.libraryItemId)
} else {
await this.$axios
.$delete(`/api/me/progress/${this.libraryItemId}`)
.then(() => {
console.log('Progress reset complete')
this.$toast.success(`Your progress was reset`)
})
.catch((error) => {
console.error('Progress reset failed', error)
})
}
this.resettingProgress = false
}
},
itemUpdated(libraryItem) {