Add total duration and listened time to series API response - #5502
Open
AryaBait7 wants to merge 1 commit into
Open
Add total duration and listened time to series API response#5502AryaBait7 wants to merge 1 commit into
AryaBait7 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Paired backend change for audiobookshelf/audiobookshelf-client-react#238 (extended) and audiobookshelf/audiobookshelf-client-react#189.
Adds
totalDurationandprogress.totalListenedto the existingGET /libraries/:id/series/:seriesIdresponse (getSeriesForLibraryinLibraryController.js).Both values are computed in-memory from
libraryItemsInSeries, which this endpoint already fetches in full (non-paginated) vialibraryItemsBookFilters.getLibraryItemsForSeries. No new SQL queries, no new routes, no new network calls from the client — same request the series page already makes.totalListenedfollows the same logic already used forlibraryItemsFinished/isFinished: for each book, use full duration if the user has finished it, otherwisecurrentTimefrom their progress.Tested locally: verified via server-side debug logging that
totalDurationcomputes 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.