mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-07-26 06:28:43 +02:00
[PR #1748] Fixes unaccurate syncing issues and potential fix for extremly large sessions #1680
Reference in New Issue
Block a user
📋 Pull Request Information
Original PR: https://github.com/advplyr/audiobookshelf-app/pull/1748
Author: @Vito0912
Created: 12/9/2025
Status: 🔄 Open
Base:
master← Head:fixSync📝 Commits (4)
9c66f6aFix syncing being inaccurate and fix potential session sync bug97b573cForgot to add fallback and downgraded gradle again89fbf68Fix session reset and fix data typesa3c061fRevert sync cap📊 Changes
3 files changed (+9 additions, -8 deletions)
View changed files
📝
android/app/src/main/java/com/audiobookshelf/app/data/LocalLibraryItem.kt(+1 -1)📝
android/app/src/main/java/com/audiobookshelf/app/data/PlaybackSession.kt(+2 -2)📝
android/app/src/main/java/com/audiobookshelf/app/media/MediaProgressSyncer.kt(+6 -5)📄 Description
Brief summary
Uses a
Doubleinstead of aLong, because the app used to send14.9xx, which always got casted to14.Now it uses precision (as it does for iOS). For this also the syncLastTime has been moved before the acutal request, because the server response time was always deducted from the next listening sync.
Also added a logic, to prevent syncs that are to big. If a sync exceeds 180 seconds (which is at max 3 times syncing), then it resets the listened time back to 0. There is no chance that 180 seconds should be accomplished. This isn't really a fix for larger sessions, but should help a lot not having them at all. At max 3 minutes are lost from listening
Which issue is fixed?
Discord, potential a few more
Pull Request Type
Android, backend
In-depth Description
See Discord conversation. Casting always "removes" a second of listened time
How have you tested this?
Mobile app
Screenshots
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.