mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-08-25 21:04:02 +02:00
Fix race condition with chapter sleep timer
This commit is contained in:
@@ -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