mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-12-25 16:18:54 +01:00
Fix crash on get recent series home page shelf endpoint
This commit is contained in:
parent
adccccbd7a
commit
a44ee913c4
@ -265,12 +265,17 @@ module.exports = {
|
||||
})
|
||||
})
|
||||
oldSeries.books = s.bookSeries.map(bs => {
|
||||
const libraryItem = bs.book.libraryItem.toJSON()
|
||||
const libraryItem = bs.book.libraryItem?.toJSON()
|
||||
if (!libraryItem) {
|
||||
Logger.warn(`Book series book has no libraryItem`, bs, bs.book, 'series=', series)
|
||||
return null
|
||||
}
|
||||
|
||||
delete bs.book.libraryItem
|
||||
libraryItem.media = bs.book
|
||||
const oldLibraryItem = Database.libraryItemModel.getOldLibraryItem(libraryItem).toJSONMinified()
|
||||
return oldLibraryItem
|
||||
})
|
||||
}).filter(b => b)
|
||||
allOldSeries.push(oldSeries)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user