mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-14 19:34:57 +02:00
Update user progress reset and delete logic
This commit is contained in:
parent
11f4caffa8
commit
6cb253598b
6 changed files with 28 additions and 7 deletions
|
@ -184,6 +184,20 @@ class User {
|
|||
}
|
||||
|
||||
resetAudiobookProgress(audiobookId) {
|
||||
if (!this.audiobooks || !this.audiobooks[audiobookId]) {
|
||||
return false
|
||||
}
|
||||
return this.updateAudiobookProgress(audiobookId, {
|
||||
progress: 0,
|
||||
currentTime: 0,
|
||||
isRead: false,
|
||||
lastUpdate: Date.now(),
|
||||
startedAt: null,
|
||||
finishedAt: null
|
||||
})
|
||||
}
|
||||
|
||||
deleteAudiobookProgress(audiobookId) {
|
||||
if (!this.audiobooks || !this.audiobooks[audiobookId]) {
|
||||
return false
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue