Fix playback stopping and progress saving bugs#129
Open
8bitgentleman wants to merge 1 commit into
Open
Conversation
This commit addresses two major user-reported issues:
1. Playback stopping on multitask/lock:
- Add WAKE_LOCK and FOREGROUND_SERVICE_MEDIA_PLAYBACK permissions
- Configure ExoPlayer with wake mode for CPU/WiFi keep-alive
- Add WifiLock to prevent WiFi disconnection during streaming
- Fix onTaskRemoved to not stop playback (let foreground service continue)
2. Progress not saving / randomly resetting:
- Fix critical bug: bookRepository.updateProgress() was receiving trackProgress
instead of bookProgress, causing progress to reset to current track position
- Fix silent DB update failures by removing timestamp WHERE clause
- Fix network sync overwriting local progress with older data (now uses maxOf)
- Convert PlexSyncScrobbleWorker to CoroutineWorker to ensure sync completes
- Save progress when app is swiped away
Files modified:
- AndroidManifest.xml: Added required permissions
- ProgressUpdater.kt: Fixed trackProgress -> bookProgress bug
- MediaPlayerService.kt: Fixed onTaskRemoved, added WifiLock
- ServiceModule.kt: Added ExoPlayer wake mode
- BookDatabase.kt: Fixed silent update failure
- MediaItemTrack.kt, Audiobook.kt: Fixed merge logic to preserve max progress
- PlexSyncScrobbleWorker.kt: Converted to CoroutineWorker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes two critical bugs affecting audiobook playback:
place and playback stops unexpectedly
previous positions
Changes
1. Playback stopping on multitask/lock
2. Progress not saving / randomly resetting
trackProgressinstead ofbookProgress, causing progress to reset to currenttrack position (ProgressUpdater.kt:227)
Fixes #112 may also help with #88