Add infra to handle with feed healthy

This commit is contained in:
mfcar 2023-09-23 20:38:03 +01:00
parent 102c90c4e8
commit 2b3c3cd088
No known key found for this signature in database
6 changed files with 412 additions and 365 deletions

View file

@ -115,6 +115,19 @@ class PodcastController {
res.json({ podcast })
}
async checkPodcastFeed(req, res) {
const libraryItem = req.libraryItem
const podcast = await getPodcastFeed(libraryItem.media.metadata.feedUrl)
if (!podcast) {
this.podcastManager.setFeedHealthStatus(libraryItem, false)
return res.status(404).send('Podcast RSS feed request failed or invalid response data')
}
this.podcastManager.setFeedHealthStatus(libraryItem, true)
res.json({ podcast })
}
async getFeedsFromOPMLText(req, res) {
if (!req.body.opmlText) {
return res.sendStatus(400)