mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-13 04:41:36 +00:00
Make OPML import non-blocking
This commit is contained in:
parent
b6875a44cf
commit
0c8285a4ae
4 changed files with 40 additions and 17 deletions
|
|
@ -133,7 +133,7 @@ class PodcastController {
|
|||
res.json({ podcast })
|
||||
}
|
||||
|
||||
async getFeedsFromOPMLText(req, res) {
|
||||
getFeedsFromOPMLText(req, res) {
|
||||
if (!req.user.isAdminOrUp) {
|
||||
Logger.error(`[PodcastController] Non-admin user "${req.user.username}" attempted to get feeds from opml`)
|
||||
return res.sendStatus(403)
|
||||
|
|
@ -143,8 +143,18 @@ class PodcastController {
|
|||
return res.sendStatus(400)
|
||||
}
|
||||
|
||||
const rssFeedsData = await this.podcastManager.getOPMLFeeds(req.body.opmlText)
|
||||
res.json(rssFeedsData)
|
||||
this.podcastManager
|
||||
.getOPMLFeeds(req.body.opmlText)
|
||||
.then((rssFeedsData) => {
|
||||
Logger.info('[PodcastController] getOPMLFeeds finished successfully')
|
||||
SocketAuthority.emitter('opml_feeds', rssFeedsData)
|
||||
})
|
||||
.catch((error) => {
|
||||
Logger.error('[PodcastController] getOPMLFeeds error:', error)
|
||||
SocketAuthority.emitter('opml_feeds', { error: error.message })
|
||||
})
|
||||
Logger.info('[PodcastController] getOPMLFeeds started')
|
||||
res.sendStatus(200)
|
||||
}
|
||||
|
||||
async checkNewEpisodes(req, res) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue