Skip to content

Enhancement: Two-way Sync (Progress & Stats) for Audiobookshelf Integration #1423

@pheistman

Description

@pheistman

Feature request

  • Describe in broad strokes the changes or enhancements you'd like to see

Now that the request to "consider adding support to stream from and/or download books from audiobookshelf" has been successfully completed and closed (Issue #1042), I propose extending this integration to support two-way synchronization. Currently, the application allows consumption of content, but this enhancement would ensure that listening progress, "finished" states, and listening statistics are pushed back to the Audiobookshelf server. This ensures the user's progress is reflected across other clients connected to the same server.

Narrative

  • Feel free to change the following format to better suit the details of the enhancement

GIVEN:

  • Provide the context of the application
  • An authenticated user has successfully connected BookPlayer to their Audiobookshelf instance.
  • The user has downloaded or is streaming an audiobook from this source.

WHEN:

  • Describe the action or trigger
  • The user listens to a portion of the audiobook, pauses playback, or marks the book as "Finished" within the BookPlayer interface.
  • Offline support (eg LAN only docker homelab audiobookshelf server) - The user returns to their home network, and BookPlayer re-establishes a connection to the Audiobookshelf server.

THEN:

  • Describe the resulting change of the state in the application
  • BookPlayer sends a request to the Audiobookshelf server to update the listening session, playback position, and completion status, ensuring the server-side statistics match the local device state.
  • BookPlayer provides an option to export listening stats (e.g., as JSON or via API), or automatically syncs playback progress back to the Audiobookshelf server using its API endpoints
  • (Offline support) BookPlayer automatically batches the cached local playback sessions and progress updates.
  • The app sends this data to the server, ensuring the user's "Listening Stats" (total time listened) and "Media Progress" (current timestamp/finished state) are accurately updated server-side.

Design

Provide design example, screenshot, text input/output etc

  • Add an “Export Stats” button in the BookPlayer UI, allowing users to export their listening progress for selected books. Currently, the profile page only shows the "Total Listening Time"
  • Optionally, add a “Sync with Audiobookshelf” toggle in settings, which, when enabled, pushes listening progress to the user’s Audiobookshelf server via its API.
  • Optionally, allow users to configure their Audiobookshelf server URL and API key/token in BookPlayer settings.

Proposed UI Changes: In the existing Audiobookshelf connection settings (implemented via the work in Issue #1042), add a toggle switch or configuration option:

  • Label: "Sync Progress to Server"
  • Description: "Automatically push listening position and finished status back to Audiobookshelf."
  • Default State: Enabled

Data Flow:

  1. On Pause/Stop: Trigger sync to update progress and currentTime.
  2. On Completion: Trigger sync to mark the item as read or finished on the server.
    In both cases if the server is unavailable then cache this information to be resent when server is available again.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions