Fix:Clean user data on server start removing invalid media progress items

This commit is contained in:
advplyr 2022-09-28 17:12:27 -05:00
parent 9ee6eaade9
commit ac30a971c5
9 changed files with 107 additions and 70 deletions

View file

@ -411,10 +411,10 @@ export default {
text: 'Re-Scan'
})
}
if (this.userIsAdminOrUp && this.series && this.bookMount) {
if (this.series && this.bookMount) {
items.push({
func: 'hideSeriesFromHome',
text: 'Hide Series from Home'
func: 'hideSeriesFromContinueListening',
text: 'Hide Series from Continue Series'
})
}
return items
@ -595,17 +595,17 @@ export default {
// More menu func
this.store.commit('showEditModalOnTab', { libraryItem: this.libraryItem, tab: 'match' })
},
hideSeriesFromHome() {
hideSeriesFromContinueListening() {
const axios = this.$axios || this.$nuxt.$axios
this.processing = true
axios
.$patch(`/api/series/${this.series.id}`, { hideFromHome: true })
.$post(`/api/me/series/${this.series.id}/hide`)
.then((data) => {
console.log('Series updated', data)
console.log('User updated', data)
})
.catch((error) => {
console.error('Failed to hide series from home', error)
this.$toast.error('Failed to update series')
this.$toast.error('Failed to update user')
})
.finally(() => {
this.processing = false