[Enhancement]: Add dedicated media progress endpoint filtered by library item ID
Type of Enhancement
Server Backend
Describe the Feature/Enhancement
Type of Enhancement
Server Backend / API
Describe the feature/enhancement
Please add a dedicated endpoint for fetching media progress for a specific library item, for example:
GET /api/progress?libraryItemId=<libraryItemId>
Currently, clients need to call GET /api/me, read the full authenticated user payload, and then filter mediaProgress locally for a single item. The API docs show that /api/me includes the full user object with mediaProgress, bookmarks, permissions, and other user/server-related data, so this is much heavier than necessary for item-specific progress loading. [page:1]
Current behavior
Client code currently has to do something like this:
val progress =
dataRepository
.fetchUserInfoResponse()
.fold(
onSuccess = { it.mediaProgress ?: emptyList() },
onFailure = { emptyList() },
)
if (progress.isEmpty()) {
return@async null
}
progress
.filter { it.libraryItemId == bookId }
.filterNot { it.episodeId == null }
.sortedByDescending { it.lastUpdate }
.distinctBy { it.episodeId }Under the hood this goes through:
@GET("api/me")
suspend fun fetchUserInfo(): Response<UserResponse>So when opening a single item page, the client has to fetch all user progress entries and filter them locally for just one libraryItemId.
Problem
This is inefficient because:
- the payload is much larger than needed for a single item;
- client performance gets worse as
mediaProgressgrows; - item-specific UI depends on a general-purpose user info endpoint;
- the client has to do extra filtering, sorting, and deduplication work after downloading unrelated data.
This is especially noticeable for users with large listening histories or many podcast episode progress entries.
Proposed API
A dedicated endpoint such as:
GET /api/progress?libraryItemId=<libraryItemId>
Possible behavior:
- when
libraryItemIdis provided, return only progress entries for that item; - optionally support additional filtering such as
episodeOnly=1for podcast/item detail use cases; - optionally, without query params, return all progress entries for the authenticated user if that is useful for backward-compatible generic usage.
Example response:
{
"mediaProgress": [
{
"id": "progress_id",
"libraryItemId": "item_id",
"episodeId": "episode_id",
"duration": 1454.18449,
"progress": 0.434998929881311,
"currentTime": 632.568697,
"isFinished": false,
"hideFromContinueListening": false,
"lastUpdate": 1668586015691,
"startedAt": 1668120083771,
"finishedAt": null
}
]
}Alternative
An item-scoped route would also work well, for example:
GET /api/items/{libraryItemId}/progress
That may be more REST-friendly, especially since the requested data is tied to a single library item.
Prior art in the API
Audiobookshelf already has a more specific progress-related endpoint, GET /api/me/items-in-progress, which suggests that splitting progress use cases out from /api/me is already an accepted API direction. [page:2]
Use case
In mobile clients, item detail screens may need only the progress entries for one book or podcast, often to show episode-level listening state sorted by most recent activity. Fetching the full /api/me response just to derive that subset is unnecessarily heavy.
Why would this be helpful?
- reduces payload size for item detail requests;
- improves load time for clients that only need progress for one item;
- avoids coupling item progress UI to
/api/me; - provides a clearer API contract for progress as a resource.
Future Implementation (Screenshot)
no UI
Audiobookshelf Server Version
v2.35.1
Current Implementation (Screenshot)
No response
Source: advplyr/audiobookshelf