From e47b59750d2bc14c7d823132e0ea07a0ab4f70af Mon Sep 17 00:00:00 2001 From: Preston Date: Sun, 4 Oct 2020 18:04:28 -0400 Subject: [PATCH] Force RSS Feeds when profile has more than 125 subscribed channels --- src/renderer/views/Subscriptions/Subscriptions.js | 13 +++++++++++-- static/locales/en-US.yaml | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/renderer/views/Subscriptions/Subscriptions.js b/src/renderer/views/Subscriptions/Subscriptions.js index b84f7a86..da8cb584 100644 --- a/src/renderer/views/Subscriptions/Subscriptions.js +++ b/src/renderer/views/Subscriptions/Subscriptions.js @@ -128,6 +128,15 @@ export default Vue.extend({ this.videoList = [] return } + + let useRss = this.useRssFeeds + if (this.activeSubscriptionList.length >= 125 && !useRss) { + this.showToast({ + message: this.$t('Subscriptions["This profile has a large number of subscriptions. Forcing RSS to avoid rate limiting"]'), + time: 10000 + }) + useRss = true + } this.isLoading = true this.updateShowProgressBar(true) this.setProgressBarPercentage(0) @@ -139,13 +148,13 @@ export default Vue.extend({ let videos = [] if (!this.usingElectron || this.backendPreference === 'invidious') { - if (this.useRssFeeds) { + if (useRss) { videos = await this.getChannelVideosInvidiousRSS(channel) } else { videos = await this.getChannelVideosInvidiousScraper(channel) } } else { - if (this.useRssFeeds) { + if (useRss) { videos = await this.getChannelVideosLocalRSS(channel) } else { videos = await this.getChannelVideosLocalScraper(channel) diff --git a/static/locales/en-US.yaml b/static/locales/en-US.yaml index cb910672..c1208313 100644 --- a/static/locales/en-US.yaml +++ b/static/locales/en-US.yaml @@ -72,6 +72,7 @@ Subscriptions: # On Subscriptions Page Subscriptions: Subscriptions Latest Subscriptions: Latest Subscriptions + This profile has a large number of subscriptions. Forcing RSS to avoid rate limiting: This profile has a large number of subscriptions. Forcing RSS to avoid rate limiting 'Your Subscription list is currently empty. Start adding subscriptions to see them here.': Your Subscription list is currently empty. Start adding subscriptions to see them here. 'Getting Subscriptions. Please wait.': Getting Subscriptions. Please wait.