Skip to content

Add total duration and listened time to series API response - #5502

Open
AryaBait7 wants to merge 1 commit into
advplyr:masterfrom
AryaBait7:feat-189-series-duration-listened
Open

Add total duration and listened time to series API response#5502
AryaBait7 wants to merge 1 commit into
advplyr:masterfrom
AryaBait7:feat-189-series-duration-listened

Conversation

@AryaBait7

Copy link
Copy Markdown

Paired backend change for audiobookshelf/audiobookshelf-client-react#238 (extended) and audiobookshelf/audiobookshelf-client-react#189.

Adds totalDuration and progress.totalListened to the existing GET /libraries/:id/series/:seriesId response (getSeriesForLibrary in LibraryController.js).

Both values are computed in-memory from libraryItemsInSeries, which this endpoint already fetches in full (non-paginated) via libraryItemsBookFilters.getLibraryItemsForSeries. No new SQL queries, no new routes, no new network calls from the client — same request the series page already makes.

totalListened follows the same logic already used for libraryItemsFinished/isFinished: for each book, use full duration if the user has finished it, otherwise currentTime from their progress.

Tested locally: verified via server-side debug logging that totalDuration computes correctly, then verified end-to-end against the paired frontend PR — toolbar correctly shows "(1m / 3m total)" for a test series with one partially-listened book.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants