mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-11-21 08:01:34 +01:00
Fix:Mark media as finished if less than 5 seconds remain on a sync and call progress sync again when last track ends #635
This commit is contained in:
1 parent
6161daeef0
commit
93b8e11378
5 files changed
+18
-6
No files matched your search
@@ -89,7 +89,9 @@ class MediaProgress {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.progress >= 1 && !this.isFinished) {
|
||||
var timeRemaining = this.duration - this.currentTime
|
||||
// If time remaining is less than 5 seconds then mark as finished
|
||||
if ((this.progress >= 1 || (!isNaN(timeRemaining) && timeRemaining < 5)) && !this.isFinished) {
|
||||
this.isFinished = true
|
||||
this.finishedAt = Date.now()
|
||||
this.progress = 1
|
||||
|
||||
Reference in new issue
Block a user