Fixes#367. Several chapter sleep timer issues were found, all which were address in this PR:
In chapters with multiple tracks, the sleep timer would never stop at the end of the chapter
The sleep timer would not be scheduled to stop on the current track, and nothing was calling the sleep timer logic to schedule timer once we reached the correct track to schedule the stop on
When skipping past the current chapter, the sleep timer would not always clear
Now tests if the chapter sleep timer is valid every time playback resumes, which always happens after a seek
Sometimes the currentTime from the session would be inaccurate during a track change
Solved with realm.refresh()
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/advplyr/audiobookshelf-app/pull/392
**Author:** [@ronaldheft](https://github.com/ronaldheft)
**Created:** 9/18/2022
**Status:** ✅ Merged
**Merged:** 9/19/2022
**Merged by:** [@advplyr](https://github.com/advplyr)
**Base:** `master` ← **Head:** `fix-ios-chapter-sleep-timer`
---
### 📝 Commits (1)
- [`5d23c17`](https://github.com/advplyr/audiobookshelf-app/commit/5d23c17d302dfbee8fc33a1cc60e8299847ed474) fix: iOS chapter sleep timer issues
### 📊 Changes
**3 files changed** (+18 additions, -18 deletions)
<details>
<summary>View changed files</summary>
📝 `ios/App/Shared/player/AudioPlayer.swift` (+3 -5)
📝 `ios/App/Shared/player/AudioPlayerSleepTimer.swift` (+14 -13)
📝 `ios/App/Shared/util/Database.swift` (+1 -0)
</details>
### 📄 Description
Fixes #367. Several chapter sleep timer issues were found, all which were address in this PR:
* In chapters with multiple tracks, the sleep timer would never stop at the end of the chapter
* The sleep timer would not be scheduled to stop on the current track, and nothing was calling the sleep timer logic to schedule timer once we reached the correct track to schedule the stop on
* When skipping past the current chapter, the sleep timer would not always clear
* Now tests if the chapter sleep timer is valid every time playback resumes, which always happens after a seek
* Sometimes the currentTime from the session would be inaccurate during a track change
* Solved with `realm.refresh()`
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/advplyr/audiobookshelf-app/pull/392
Author: @ronaldheft
Created: 9/18/2022
Status: ✅ Merged
Merged: 9/19/2022
Merged by: @advplyr
Base:
master← Head:fix-ios-chapter-sleep-timer📝 Commits (1)
5d23c17fix: iOS chapter sleep timer issues📊 Changes
3 files changed (+18 additions, -18 deletions)
View changed files
📝
ios/App/Shared/player/AudioPlayer.swift(+3 -5)📝
ios/App/Shared/player/AudioPlayerSleepTimer.swift(+14 -13)📝
ios/App/Shared/util/Database.swift(+1 -0)📄 Description
Fixes #367. Several chapter sleep timer issues were found, all which were address in this PR:
realm.refresh()🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.