mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-30 22:59:37 +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
|
@ -150,6 +150,7 @@ class ApiRouter {
|
|||
this.router.patch('/me/settings', MeController.updateSettings.bind(this))
|
||||
this.router.post('/me/sync-local-progress', MeController.syncLocalMediaProgress.bind(this))
|
||||
this.router.get('/me/items-in-progress', MeController.getAllLibraryItemsInProgress.bind(this))
|
||||
this.router.post('/me/series/:id/hide', MeController.hideSeriesFromContinueListening.bind(this))
|
||||
|
||||
//
|
||||
// Backup Routes
|
||||
|
@ -304,7 +305,7 @@ class ApiRouter {
|
|||
// Remove libraryItem from users
|
||||
for (let i = 0; i < this.db.users.length; i++) {
|
||||
var user = this.db.users[i]
|
||||
var madeUpdates = user.removeMediaProgress(libraryItem.id)
|
||||
var madeUpdates = user.removeMediaProgressForLibraryItem(libraryItem.id)
|
||||
if (madeUpdates) {
|
||||
await this.db.updateEntity('user', user)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue