mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-06-26 18:59:25 +02:00
Update podcast search page to support manually entering podcast RSS feed
This commit is contained in:
parent
2c6e1cc2b5
commit
4edba20e9e
6 changed files with 87 additions and 37 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue