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

@ -5,7 +5,6 @@ class Series {
this.id = null
this.name = null
this.description = null
this.hideFromHome = false
this.addedAt = null
this.updatedAt = null
@ -18,7 +17,6 @@ class Series {
this.id = series.id
this.name = series.name
this.description = series.description || null
this.hideFromHome = !!series.hideFromHome
this.addedAt = series.addedAt
this.updatedAt = series.updatedAt
}
@ -28,7 +26,6 @@ class Series {
id: this.id,
name: this.name,
description: this.description,
hideFromHome: this.hideFromHome,
addedAt: this.addedAt,
updatedAt: this.updatedAt
}
@ -46,14 +43,13 @@ class Series {
this.id = getId('ser')
this.name = data.name
this.description = data.description || null
this.hideFromHome = !!data.hideFromHome
this.addedAt = Date.now()
this.updatedAt = Date.now()
}
update(series) {
if (!series) return false
const keysToUpdate = ['name', 'description', 'hideFromHome']
const keysToUpdate = ['name', 'description']
var hasUpdated = false
for (const key of keysToUpdate) {
if (series[key] !== undefined && series[key] !== this[key]) {