mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-07 07:55:03 +02: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:
parent
4291769b93
commit
d189ec74c9
2 changed files with 7 additions and 1 deletions
|
@ -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 => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue