mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-06 23:45:07 +02:00
Fix:Clean user data on server start removing invalid media progress items
This commit is contained in:
parent
9ee6eaade9
commit
ac30a971c5
9 changed files with 107 additions and 70 deletions
|
@ -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]) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue