[PR #1853] fix: prefer freshest local or server progress on detail pages #1724

Open
opened 2026-04-25 00:00:51 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf-app/pull/1853
Author: @anatolyra
Created: 4/21/2026
Status: 🔄 Open

Base: masterHead: fix-prefer-freshest-progress


📝 Commits (3)

  • ca507ff fix: prefer freshest local or server progress on book detail page
  • 5e9d5d6 fix: prefer freshest local or server progress on episode detail page
  • 829fc46 refactor: extract progress merge logic into progressHelpers mixin

📊 Changes

3 files changed (+22 additions, -4 deletions)

View changed files

mixins/progressHelpers.js (+16 -0)
📝 pages/item/_id/_episode/index.vue (+3 -2)
📝 pages/item/_id/index.vue (+3 -2)

📄 Description

Brief summary

When a downloaded audiobook is played and the user navigates back to the book detail page, the progress percentage was stale. This is because the pages only read server progress (updated via Socket.IO roundtrip) and ignored locally-available progress (updated instantly via the native onLocalMediaProgressUpdate event).

Now each page compares local and server progress timestamps and displays whichever is more recent.

Which issue is fixed?

Addresses the stale progress display reported in https://github.com/advplyr/audiobookshelf-app/issues/857

Pull Request Type

Both android and ios, frontend Vue code only

In-depth Description

The fix adds a localProgressForServerItem computed property that looks up local progress by server item ID (using the existing getLocalMediaProgressByServerItemId getter), and modifies userItemProgress to prefer whichever source has the more recent lastUpdate timestamp.

Affected views:

  • Book detail page (pages/item/_id/index.vue)
  • Podcast episode detail page (pages/item/_id/_episode/index.vue)
  • Item more menu modal (components/modals/ItemMoreMenuModal.vue)

This eliminates the display lag because local progress is updated instantly via onLocalMediaProgressUpdate events from the native layer, while server progress only updates after a Socket.IO roundtrip.

How have you tested this?

  1. Download an audiobook
  2. Play it for a while
  3. Pause playback and navigate back to the book detail page
  4. Confirm the progress percentage updates immediately (no delay)
  5. Tested with both streaming and local playback

Screenshots

N/A (logic-only change)


🔄 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/1853 **Author:** [@anatolyra](https://github.com/anatolyra) **Created:** 4/21/2026 **Status:** 🔄 Open **Base:** `master` ← **Head:** `fix-prefer-freshest-progress` --- ### 📝 Commits (3) - [`ca507ff`](https://github.com/advplyr/audiobookshelf-app/commit/ca507fff662377ab32bbc84f99b4a6e61982ec10) fix: prefer freshest local or server progress on book detail page - [`5e9d5d6`](https://github.com/advplyr/audiobookshelf-app/commit/5e9d5d6dd7db0c6e226a4d2bdafea43e7fa835ff) fix: prefer freshest local or server progress on episode detail page - [`829fc46`](https://github.com/advplyr/audiobookshelf-app/commit/829fc4636f69109edf6072e6ef885d41e846494c) refactor: extract progress merge logic into progressHelpers mixin ### 📊 Changes **3 files changed** (+22 additions, -4 deletions) <details> <summary>View changed files</summary> ➕ `mixins/progressHelpers.js` (+16 -0) 📝 `pages/item/_id/_episode/index.vue` (+3 -2) 📝 `pages/item/_id/index.vue` (+3 -2) </details> ### 📄 Description ## Brief summary When a downloaded audiobook is played and the user navigates back to the book detail page, the progress percentage was stale. This is because the pages only read server progress (updated via Socket.IO roundtrip) and ignored locally-available progress (updated instantly via the native `onLocalMediaProgressUpdate` event). Now each page compares local and server progress timestamps and displays whichever is more recent. ## Which issue is fixed? Addresses the stale progress display reported in https://github.com/advplyr/audiobookshelf-app/issues/857 ## Pull Request Type Both android and ios, frontend Vue code only ## In-depth Description The fix adds a `localProgressForServerItem` computed property that looks up local progress by server item ID (using the existing `getLocalMediaProgressByServerItemId` getter), and modifies `userItemProgress` to prefer whichever source has the more recent `lastUpdate` timestamp. Affected views: - Book detail page (`pages/item/_id/index.vue`) - Podcast episode detail page (`pages/item/_id/_episode/index.vue`) - Item more menu modal (`components/modals/ItemMoreMenuModal.vue`) This eliminates the display lag because local progress is updated instantly via `onLocalMediaProgressUpdate` events from the native layer, while server progress only updates after a Socket.IO roundtrip. ## How have you tested this? 1. Download an audiobook 2. Play it for a while 3. Pause playback and navigate back to the book detail page 4. Confirm the progress percentage updates immediately (no delay) 5. Tested with both streaming and local playback ## Screenshots N/A (logic-only change) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-25 00:00:51 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf-app#1724