mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-10 01:15:06 +02:00
New data model update stats page and routes, update users page
This commit is contained in:
parent
4bdef893af
commit
be1e1e7ba0
7 changed files with 62 additions and 62 deletions
|
@ -370,11 +370,11 @@ class ApiController {
|
|||
// User audiobook progress attach book details
|
||||
if (json.audiobooks && Object.keys(json.audiobooks).length) {
|
||||
for (const audiobookId in json.audiobooks) {
|
||||
var audiobook = this.db.audiobooks.find(ab => ab.id === audiobookId)
|
||||
if (!audiobook) {
|
||||
Logger.error('[ApiController] Audiobook not found for users progress ' + audiobookId)
|
||||
var libraryItem = this.db.libraryItems.find(li => li.id === audiobookId)
|
||||
if (!libraryItem) {
|
||||
Logger.error('[ApiController] Library item not found for users progress ' + audiobookId)
|
||||
} else {
|
||||
json.audiobooks[audiobookId].book = audiobook.book.toJSON()
|
||||
json.audiobooks[audiobookId].media = libraryItem.media.toJSONExpanded()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue