Add:OPML Upload for bulk adding podcasts #588

This commit is contained in:
advplyr 2022-05-29 11:46:45 -05:00
parent e5469cc0f8
commit 514893646a
16 changed files with 359 additions and 18 deletions

View file

@ -104,7 +104,7 @@ class PodcastController {
return res.status(500).send('Bad response from feed request')
}
Logger.debug(`[PdocastController] Podcast feed size ${(data.data.length / 1024 / 1024).toFixed(2)}MB`)
var payload = await parsePodcastRssFeedXml(data.data, includeRaw)
var payload = await parsePodcastRssFeedXml(data.data, false, includeRaw)
if (!payload) {
return res.status(500).send('Invalid podcast RSS feed')
}
@ -119,6 +119,15 @@ class PodcastController {
})
}
async getOPMLFeeds(req, res) {
if (!req.body.opmlText) {
return res.sendStatus(400)
}
const rssFeedsData = await this.podcastManager.getOPMLFeeds(req.body.opmlText)
res.json(rssFeedsData)
}
async checkNewEpisodes(req, res) {
if (!req.user.isAdminOrUp) {
Logger.error(`[PodcastController] Non-admin user attempted to check/download episodes`, req.user)