Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto sleep timer broken #545

Closed
1 task
raviwarrier opened this issue Feb 2, 2023 · 9 comments
Closed
1 task

Auto sleep timer broken #545

raviwarrier opened this issue Feb 2, 2023 · 9 comments
Labels
bug Something isn't working

Comments

@raviwarrier
Copy link

Steps to reproduce

See attached screen recording.
https://user-images.githubusercontent.com/42061703/216403812-a3e2b385-0106-477c-8e26-e2ab027865a0.mp4

Expected behaviour

  • Tell us what should happen

When one manually cancels the timer, the timer should remain cancelled and not turn back on, and definitely not within seconds of turning it off.

If it needs to be turned on automatically, then at least wait for the duration set as the default timer duration (in the video: 15m) before turning it back on.

Actual behaviour

  • Tell us what happens

In the video, i turned off the timer, but it turned back on in a few seconds.

Environment data

Audiobookshelf Version: 0.9.61

  • [yes ] Android App?
  • iOS App?

Android Issue

Android version:

Device model:

Stock or customized system:

iOS Issue

iOS Version:

iPhone model:

@raviwarrier raviwarrier added the bug Something isn't working label Feb 2, 2023
@MrBearedJoe
Copy link

Android: For me when I used the sleep timer this morning, I paused with around 8s left then I canceled the timer. When i went to play it again the volume was still low. I checked the volume on my device and it was fine. I had to close the app and reopen.

@advplyr
Copy link
Owner

advplyr commented Feb 2, 2023

I mentioned this here in point 5 #260 (comment)

I just wasn't sure what the correct behavior should be. There are a lot of possibilities

advplyr added a commit that referenced this issue Feb 4, 2023
…lso disable the auto sleep timer setting with alert #545
@advplyr
Copy link
Owner

advplyr commented Feb 4, 2023

For next release when you go to cancel the sleep timer that has been enabled automatically the button will say "Disable Auto Timer".
So now canceling the auto sleep timer will disable the auto sleep timer settings. When pressing that button you will also have to confirm an alert message letting you know that the setting will have to be re-enabled in settings.

@advplyr
Copy link
Owner

advplyr commented Feb 4, 2023

@MrBearedJoe I wasn't able to reproduce this. Let me know if this is something you can reproduce.

@raviwarrier
Copy link
Author

For next release when you go to cancel the sleep timer that has been enabled automatically the button will say "Disable Auto Timer".
So now canceling the auto sleep timer will disable the auto sleep timer settings. When pressing that button you will also have to confirm an alert message letting you know that the setting will have to be re-enabled in settings.

Here's what I would suggest:

Solution 1 - When auto sleep timer is cancelled, disable it just temporarily (reset it at the end of the auto sleep timer period, example: if set from 11p - 6a, enable it back at 6a automatically instead of making the user turn it back on manually).

Solution 2 - same as above, but instead of disabling it until next period (eg, 6a), disable it for just 30/60m extra. So, if the timer period is set for 11p-6a and duration is set for 15m [turning playback off at 11:15p automatically], if cancelled, the duration can be extended to 45m (original 15m + 30m extra) thus turning playback off at 12a.

This problem, in my guess, affects only those users who set short durations (10-30m). So, solution 2 should work for them well.

@revilo951
Copy link

I agree, there should be at least an option for just "Disable the sleep timer for tonight", and not only one option that disables it altogether.

@advplyr
Copy link
Owner

advplyr commented Feb 23, 2023

Updated in v0.9.62-beta

This was originally a bug and I solved it the same way that I saw another popular audiobook app doing it. Feel free to open a feature request on enhancing it further.

@calebj
Copy link

calebj commented Feb 25, 2023

Android: For me when I used the sleep timer this morning, I paused with around 8s left then I canceled the timer. When i went to play it again the volume was still low. I checked the volume on my device and it was fine. I had to close the app and reopen.

@MrBearedJoe I wasn't able to reproduce this. Let me know if this is something you can reproduce.

I can reproduce this (on Android, using 0.9.62-beta). Neither resetting the timer nor canceling it restores the volume during the last minute of the sleep countdown. But instead of having to restart the app like Joe reported, I just have to pause and resume the playback (which also resets the timer). Adjusting the timer also restores the volume. After poking at the code a bit, this looks like a case of missing calls to setVolume() in SleepTimerManager.kt. I'm curious how you're not experiencing the issue yourself.

@advplyr
Copy link
Owner

advplyr commented Feb 25, 2023

@calebj I wasn't able to reproduce because I was pausing and resuming as per the original comment. I was able to reproduce it by just canceling the sleep timer without pausing. Just fixed it for next release in #605. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants