Update:Only load feeds when needed

This commit is contained in:
advplyr 2023-07-17 16:48:46 -05:00
parent 20c11e381e
commit 6814adffcc
10 changed files with 125 additions and 55 deletions

View file

@ -13,7 +13,7 @@ class LibraryItemController {
constructor() { }
// Example expand with authors: api/items/:id?expanded=1&include=authors
findOne(req, res) {
async findOne(req, res) {
const includeEntities = (req.query.include || '').split(',')
if (req.query.expanded == 1) {
var item = req.libraryItem.toJSONExpanded()
@ -25,8 +25,8 @@ class LibraryItemController {
}
if (includeEntities.includes('rssfeed')) {
const feedData = this.rssFeedManager.findFeedForEntityId(item.id)
item.rssFeed = feedData ? feedData.toJSONMinified() : null
const feedData = await this.rssFeedManager.findFeedForEntityId(item.id)
item.rssFeed = feedData?.toJSONMinified() || null
}
if (item.mediaType == 'book') {