mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-10 01:15:06 +02:00
Update user progress reset and delete logic
This commit is contained in:
parent
9107620b3c
commit
5dd1542af0
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