diff --git a/client/src/App.vue b/client/src/App.vue index ec04f3b36..a97daf7c9 100644 --- a/client/src/App.vue +++ b/client/src/App.vue @@ -3,7 +3,7 @@
@@ -18,7 +18,7 @@ - +
@@ -322,7 +322,11 @@ export default { this.getOverview(true); //invoke ref home child component function to reload content this.$refs.home.fetchArticleIds(this.store.currentSelection); - } + }, + refreshFeeds() { + //call sidebar refreshFeeds function + this.$refs.sidebar.refreshFeeds(); + }, }, //watch the store.currentSelection, set local data (category, feed) based on current selection watch: { diff --git a/client/src/components/Mobile.vue b/client/src/components/Mobile.vue index 91912bcea..fe4cf2e6a 100644 --- a/client/src/components/Mobile.vue +++ b/client/src/components/Mobile.vue @@ -34,6 +34,10 @@ +

Refresh feeds

+ +
+

Click the button below to add a new feed


@@ -164,6 +168,9 @@ export default { this.emitClickEvent("mobile", null); this.$emit("modal", "newfeed"); }, + refreshFeeds() { + this.$emit('refresh'); + }, subscribeNotifications() { //register service worker Notification.requestPermission().then(function(permission) { diff --git a/server/controllers/crawl.js b/server/controllers/crawl.js index 2f550b0a1..6fc6473ff 100644 --- a/server/controllers/crawl.js +++ b/server/controllers/crawl.js @@ -2,7 +2,7 @@ import Sequelize from 'sequelize'; import Feed from "../models/feed.js"; import Article from "../models/article.js"; -import autodiscover from "../util/autodiscover.js"; +import discoverRssLink from "../util/discoverRssLink.js"; import parseFeed from "../util/parser.js"; import language from "../util/language.js"; import { load } from 'cheerio'; @@ -53,7 +53,7 @@ const crawlRssLinks = catchAsync(async (req, res, next) => { feeds.forEach(async function(feed) { //discover RssLink - const url = await autodiscover.discoverRssLink(feed.url); + const url = await discoverRssLink.discoverRssLink(feed.url); //do not process undefined URLs if (typeof url !== "undefined") { @@ -62,15 +62,10 @@ const crawlRssLinks = catchAsync(async (req, res, next) => { const feeditem = await parseFeed.process(url); if (feeditem) { - var articleCount = 0; - //process all feed posts feeditem.posts.forEach(function(post) { processArticle(feed, post); - articleCount++; }); - - console.log("Discovered " + articleCount + " articles for feed: " + url) //reset the feed count feed.update({ diff --git a/server/controllers/feed.js b/server/controllers/feed.js index 3e7d4cb50..03bde192a 100644 --- a/server/controllers/feed.js +++ b/server/controllers/feed.js @@ -1,7 +1,7 @@ import Feed from "../models/feed.js"; import Article from "../models/article.js"; -import autodiscover from "../util/autodiscover.js"; +import discoverRssLink from "../util/discoverRssLink.js"; import parseFeed from "../util/parser.js"; const getFeeds = async (req, res, next) => { @@ -106,7 +106,7 @@ const deleteFeed = async (req, res, next) => { const validateFeed = async (req, res, next) => { //resolve url - const url = await autodiscover.discoverRssLink(req.body.url); + const url = await discoverRssLink.discoverRssLink(req.body.url); const categoryId = req.body.categoryId; if (typeof url === "undefined") { diff --git a/server/util/autodiscover.js b/server/util/discoverRssLink.js similarity index 100% rename from server/util/autodiscover.js rename to server/util/discoverRssLink.js