mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-03-22 02:18:54 +01:00
Update item api endpoint to include user media progress with item if using query string include=progress and optionally episode=episodeid - for mobile app downloads
This commit is contained in:
@@ -11,6 +11,12 @@ class LibraryItemController {
|
||||
if (req.query.expanded == 1) {
|
||||
var item = req.libraryItem.toJSONExpanded()
|
||||
|
||||
// Include users media progress
|
||||
if (includeEntities.includes('progress')) {
|
||||
var episodeId = req.query.episode || null
|
||||
item.userMediaProgress = req.user.getMediaProgress(item.id, episodeId)
|
||||
}
|
||||
|
||||
if (item.mediaType == 'book') {
|
||||
if (includeEntities.includes('authors')) {
|
||||
item.media.metadata.authors = item.media.metadata.authors.map(au => {
|
||||
|
||||
Reference in New Issue
Block a user