mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-08-04 02:05:06 +02:00
Fix: hotkeys prevent default browser behavior #135, Fix: mark audiobook as read when less than 10s remaining
This commit is contained in:
parent
aca88f73ad
commit
874c910e24
9 changed files with 69 additions and 39 deletions
|
@ -54,11 +54,9 @@ class AudiobookProgress {
|
|||
// If has < 10 seconds remaining mark as read
|
||||
var timeRemaining = this.totalDuration - this.currentTime
|
||||
if (timeRemaining < 10) {
|
||||
if (!this.isRead) {
|
||||
this.isRead = true
|
||||
this.progress = 1
|
||||
this.finishedAt = Date.now()
|
||||
}
|
||||
this.isRead = true
|
||||
this.progress = 1
|
||||
this.finishedAt = Date.now()
|
||||
} else {
|
||||
this.isRead = false
|
||||
this.finishedAt = null
|
||||
|
|
|
@ -88,7 +88,8 @@ class Stream extends EventEmitter {
|
|||
|
||||
get clientProgress() {
|
||||
if (!this.clientCurrentTime) return 0
|
||||
return Number((this.clientCurrentTime / this.totalDuration).toFixed(3))
|
||||
var prog = Math.max(1, this.clientCurrentTime / this.totalDuration)
|
||||
return Number(prog.toFixed(3))
|
||||
}
|
||||
|
||||
toJSON() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue