Fixing the rss incoming server side

This commit is contained in:
mfcar 2023-10-01 01:21:07 +01:00
parent 4de5b92fa7
commit 7f5fde1de2
No known key found for this signature in database
4 changed files with 8 additions and 8 deletions

View file

@ -115,8 +115,8 @@ class PodcastController {
res.json({ podcast }) res.json({ podcast })
} }
async getPodcastsWithInboundFeed(req, res) { async getPodcastsWithIncomingFeeds(req, res) {
const podcasts = await Database.podcastModel.getAllInboundFeeds() const podcasts = await Database.podcastModel.getAllIncomingFeeds()
res.json({ res.json({
podcasts podcasts
}) })

View file

@ -409,9 +409,9 @@ class PodcastManager {
} }
} }
async getPodcastsWithInboundFeed() { async getPodcastsWithIncomingFeeds() {
const podcasts = await Database.models.podcast.getAllInboundFeeds() const podcasts = await Database.models.podcast.getAllIncomingFeeds()
Logger.info(`[PodcastManager] Fetched all podcasts with feed`) Logger.info(`[PodcastManager] Fetched ${podcasts.length} podcasts with incoming feeds`)
return podcasts return podcasts
} }
} }

View file

@ -120,9 +120,9 @@ class Podcast extends Model {
} }
} }
static async getAllInboundFeeds(){ static async getAllIncomingFeeds(){
const podcasts = await this.findAll() const podcasts = await this.findAll()
return podcasts.map(p => this.getFromOld(p)) return podcasts.map(p => this.getFromOld({metadata: p.dataValues}))
} }
/** /**

View file

@ -227,7 +227,7 @@ class ApiRouter {
// //
this.router.post('/podcasts', PodcastController.create.bind(this)) this.router.post('/podcasts', PodcastController.create.bind(this))
this.router.post('/podcasts/feed', PodcastController.getPodcastFeed.bind(this)) this.router.post('/podcasts/feed', PodcastController.getPodcastFeed.bind(this))
this.router.get('/podcasts/inboundFeeds', PodcastController.getPodcastsWithInboundFeed.bind(this)) this.router.get('/podcasts/incomingFeeds', PodcastController.getPodcastsWithIncomingFeeds.bind(this))
this.router.get('/podcasts/:id/feed', PodcastController.middleware.bind(this), PodcastController.checkPodcastFeed.bind(this)) this.router.get('/podcasts/:id/feed', PodcastController.middleware.bind(this), PodcastController.checkPodcastFeed.bind(this))
this.router.post('/podcasts/opml', PodcastController.getFeedsFromOPMLText.bind(this)) this.router.post('/podcasts/opml', PodcastController.getFeedsFromOPMLText.bind(this))
this.router.get('/podcasts/:id/checknew', PodcastController.middleware.bind(this), PodcastController.checkNewEpisodes.bind(this)) this.router.get('/podcasts/:id/checknew', PodcastController.middleware.bind(this), PodcastController.checkNewEpisodes.bind(this))