Add:Experimental generate podcast RSS feed #553

This commit is contained in:
advplyr 2022-05-02 16:42:30 -05:00
parent 8b38dda229
commit 678dceefed
7 changed files with 208 additions and 12 deletions

View file

@ -17,6 +17,11 @@ class LibraryItemController {
item.userMediaProgress = req.user.getMediaProgress(item.id, episodeId)
}
if (includeEntities.includes('rssfeed')) {
var feedData = this.rssFeedManager.findFeedForItem(item.id)
item.rssFeedUrl = feedData ? feedData.feedUrl : null
}
if (item.mediaType == 'book') {
if (includeEntities.includes('authors')) {
item.media.metadata.authors = item.media.metadata.authors.map(au => {

View file

@ -168,7 +168,7 @@ class PodcastController {
async openPodcastFeed(req, res) {
if (!req.user.isAdminOrUp) {
Logger.error(`[PodcastController] Non-admin user attempted to open podcast feed`, req.user)
Logger.error(`[PodcastController] Non-admin user attempted to open podcast feed`, req.user.username)
return res.sendStatus(500)
}
@ -180,6 +180,17 @@ class PodcastController {
})
}
async closePodcastFeed(req, res) {
if (!req.user.isAdminOrUp) {
Logger.error(`[PodcastController] Non-admin user attempted to close podcast feed`, req.user.username)
return res.sendStatus(500)
}
this.rssFeedManager.closePodcastFeedForItem(req.params.id)
res.sendStatus(200)
}
async updateEpisode(req, res) {
var libraryItem = req.libraryItem