mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-11-29 11:52:45 +01:00
Update podcast search page to support manually entering podcast RSS feed
This commit is contained in:
1 parent
2c6e1cc2b5
commit
4edba20e9e
6 files changed
+87
-37
No files matched your search
@@ -94,17 +94,18 @@ class PodcastController {
|
||||
if (!url) {
|
||||
return res.status(400).send('Bad request')
|
||||
}
|
||||
var includeRaw = req.query.raw == 1 // Include raw json
|
||||
|
||||
axios.get(url).then(async (data) => {
|
||||
if (!data || !data.data) {
|
||||
Logger.error('Invalid podcast feed request response')
|
||||
return res.status(500).send('Bad response from feed request')
|
||||
}
|
||||
var podcast = await parsePodcastRssFeedXml(data.data)
|
||||
if (!podcast) {
|
||||
var payload = await parsePodcastRssFeedXml(data.data, includeRaw)
|
||||
if (!payload) {
|
||||
return res.status(500).send('Invalid podcast RSS feed')
|
||||
}
|
||||
res.json(podcast)
|
||||
res.json(payload)
|
||||
}).catch((error) => {
|
||||
console.error('Failed', error)
|
||||
res.status(500).send(error)
|
||||
|
||||
Reference in new issue
Block a user