mirror of
https://github.com/sudoxnym/audiobookshelf-atv.git
synced 2026-07-13 23:42:21 +00:00
Fix: shake to reset only during grace period or while playing
This commit is contained in:
parent
c7f51e815c
commit
e7e03697d6
1 changed files with 5 additions and 2 deletions
|
|
@ -343,9 +343,12 @@ constructor(private val playerNotificationService: PlayerNotificationService) {
|
|||
}
|
||||
}
|
||||
|
||||
/** Handles the shake event to reset the sleep timer. */
|
||||
/**
|
||||
* Handles the shake event to reset the sleep timer. Shaking to reset only works during the 2
|
||||
* minute grace period after the timer ends or while media is playing.
|
||||
*/
|
||||
fun handleShake() {
|
||||
if (sleepTimerRunning || sleepTimerFinishedAt > 0L) {
|
||||
if ((sleepTimerRunning && getIsPlaying()) || sleepTimerFinishedAt > 0L) {
|
||||
if (DeviceManager.deviceData.deviceSettings?.disableShakeToResetSleepTimer == true) {
|
||||
Log.d(tag, "Shake to reset sleep timer is disabled")
|
||||
return
|
||||
|
|
|
|||
Loading…
Reference in a new issue