mattttvaughn / chronicle

GNU General Public License v3.0
214 stars 58 forks source link

Bug - End of Chapter Sleep Timer doesn't work w/ Modified Playback Speed #101

Open some-guy-23 opened 1 year ago

some-guy-23 commented 1 year ago

It appears when choosing "end of chapter" in the sleep timer, it doesn't take into account the current playback speed. So if you are listening at 1.2x, and the chapter is 30 minutes long, it will play for exactly 30 minutes, going past the end of the chapter.

some-guy-23 commented 1 year ago

Looking into this more, and it is actually adding additional time to the "end of chapter" sleep timer when Playback speed is higher than 1x. This is an order-of-operations issues with the math involved calculating remaining time, since it is doing the division first - https://github.com/mattttvaughn/chronicle/blob/develop/app/src/main/java/io/github/mattpvaughn/chronicle/features/currentlyplaying/CurrentlyPlayingViewModel.kt#L602

I've created a PR w/ the simple fix here - https://github.com/mattttvaughn/chronicle/pull/102