mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-10 11:21:36 +00:00
Add infra to handle with feed healthy
This commit is contained in:
parent
102c90c4e8
commit
2b3c3cd088
6 changed files with 412 additions and 365 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue