mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-11-21 07:51:31 +01:00
Fix race condition with chapter sleep timer
This commit is contained in:
1 parent
c8ff5a7817
commit
836ffddd4f
1 file changed
+2
-2
@@ -27,8 +27,8 @@ extension AudioPlayer {
|
||||
sleepTimeRemaining = self.sleepTimeRemaining
|
||||
}
|
||||
|
||||
// Guard against invalid sleep timers
|
||||
if sleepTimeRemaining?.isLess(than: 0) ?? false {
|
||||
// Guard against invalid sleep timers, but give it a chance to go 1 second negative to prevent a raise condition
|
||||
if sleepTimeRemaining?.isLess(than: -1) ?? false {
|
||||
self.removeSleepTimer()
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user