mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-12-14 15:59:38 +00:00
parent
4021b6eca1
commit
308ccf470f
5 changed files with 211 additions and 9 deletions
|
|
@ -26,7 +26,16 @@ class CollectionController {
|
|||
}
|
||||
|
||||
findOne(req, res) {
|
||||
res.json(req.collection.toJSONExpanded(this.db.libraryItems))
|
||||
const includeEntities = (req.query.include || '').split(',')
|
||||
|
||||
const collectionExpanded = req.collection.toJSONExpanded(this.db.libraryItems)
|
||||
|
||||
if (includeEntities.includes('rssfeed')) {
|
||||
const feedData = this.rssFeedManager.findFeedForEntityId(collectionExpanded.id)
|
||||
collectionExpanded.rssFeed = feedData ? feedData.toJSONMinified() : null
|
||||
}
|
||||
|
||||
res.json(collectionExpanded)
|
||||
}
|
||||
|
||||
async update(req, res) {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class LibraryItemController {
|
|||
}
|
||||
|
||||
if (includeEntities.includes('rssfeed')) {
|
||||
const feedData = this.rssFeedManager.findFeedForItem(item.id)
|
||||
const feedData = this.rssFeedManager.findFeedForEntityId(item.id)
|
||||
item.rssFeed = feedData ? feedData.toJSONMinified() : null
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,8 +28,8 @@ class RssFeedManager {
|
|||
}
|
||||
}
|
||||
|
||||
findFeedForItem(libraryItemId) {
|
||||
return Object.values(this.feeds).find(feed => feed.entityId === libraryItemId)
|
||||
findFeedForEntityId(entityId) {
|
||||
return Object.values(this.feeds).find(feed => feed.entityId === entityId)
|
||||
}
|
||||
|
||||
findFeed(feedId) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue