From 7f5fde1de25b222aa7cdbeea967ca598c739bb9c Mon Sep 17 00:00:00 2001 From: mfcar Date: Sun, 1 Oct 2023 01:21:07 +0100 Subject: [PATCH] Fixing the rss incoming server side --- server/controllers/PodcastController.js | 4 ++-- server/managers/PodcastManager.js | 6 +++--- server/models/Podcast.js | 4 ++-- server/routers/ApiRouter.js | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/server/controllers/PodcastController.js b/server/controllers/PodcastController.js index 0c12620bc..6f1138fb5 100644 --- a/server/controllers/PodcastController.js +++ b/server/controllers/PodcastController.js @@ -115,8 +115,8 @@ class PodcastController { res.json({ podcast }) } - async getPodcastsWithInboundFeed(req, res) { - const podcasts = await Database.podcastModel.getAllInboundFeeds() + async getPodcastsWithIncomingFeeds(req, res) { + const podcasts = await Database.podcastModel.getAllIncomingFeeds() res.json({ podcasts }) diff --git a/server/managers/PodcastManager.js b/server/managers/PodcastManager.js index 4ac810443..45affb24f 100644 --- a/server/managers/PodcastManager.js +++ b/server/managers/PodcastManager.js @@ -409,9 +409,9 @@ class PodcastManager { } } - async getPodcastsWithInboundFeed() { - const podcasts = await Database.models.podcast.getAllInboundFeeds() - Logger.info(`[PodcastManager] Fetched all podcasts with feed`) + async getPodcastsWithIncomingFeeds() { + const podcasts = await Database.models.podcast.getAllIncomingFeeds() + Logger.info(`[PodcastManager] Fetched ${podcasts.length} podcasts with incoming feeds`) return podcasts } } diff --git a/server/models/Podcast.js b/server/models/Podcast.js index 00f0f7b99..a1c58d4bb 100644 --- a/server/models/Podcast.js +++ b/server/models/Podcast.js @@ -120,9 +120,9 @@ class Podcast extends Model { } } - static async getAllInboundFeeds(){ + static async getAllIncomingFeeds(){ const podcasts = await this.findAll() - return podcasts.map(p => this.getFromOld(p)) + return podcasts.map(p => this.getFromOld({metadata: p.dataValues})) } /** diff --git a/server/routers/ApiRouter.js b/server/routers/ApiRouter.js index 421eec00e..f58c0d3ae 100644 --- a/server/routers/ApiRouter.js +++ b/server/routers/ApiRouter.js @@ -227,7 +227,7 @@ class ApiRouter { // this.router.post('/podcasts', PodcastController.create.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.post('/podcasts/opml', PodcastController.getFeedsFromOPMLText.bind(this)) this.router.get('/podcasts/:id/checknew', PodcastController.middleware.bind(this), PodcastController.checkNewEpisodes.bind(this))