mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Only index discover stories for premium archive users.
This commit is contained in:
parent
153cb876b5
commit
58e66f7f23
3 changed files with 11 additions and 1 deletions
|
@ -382,6 +382,11 @@ class Feed(models.Model):
|
|||
if self.discover_indexed and not force:
|
||||
return
|
||||
|
||||
# If there are no premium archive subscribers, don't index stories for discover.
|
||||
if not self.archive_subscribers or self.archive_subscribers <= 0:
|
||||
logging.debug(f" ---> ~FBNo premium archive subscribers, skipping discover index for {self}")
|
||||
return
|
||||
|
||||
stories = MStory.objects(story_feed_id=self.pk)
|
||||
for index, story in enumerate(stories):
|
||||
if index % 100 == 0:
|
||||
|
|
|
@ -5838,6 +5838,7 @@ body {
|
|||
padding: 16px;
|
||||
text-align: center;
|
||||
color: #999;
|
||||
line-height: 1.25;
|
||||
}
|
||||
|
||||
.NB-discover-loading {
|
||||
|
|
|
@ -136,6 +136,10 @@ NEWSBLUR.Views.DiscoverStoriesView = Backbone.View.extend({
|
|||
|
||||
render: function () {
|
||||
var self = this;
|
||||
var discover_indexed_count = NEWSBLUR.assets.feeds.reduce(function (sum, feed) {
|
||||
return sum + (feed.get('discover_indexed') ? 1 : 0);
|
||||
}, 0);
|
||||
var feed_count = NEWSBLUR.assets.feeds.length;
|
||||
|
||||
if (this.page === 1) {
|
||||
this.$('.NB-sideoption-discover-content').empty();
|
||||
|
@ -212,7 +216,7 @@ NEWSBLUR.Views.DiscoverStoriesView = Backbone.View.extend({
|
|||
])),
|
||||
(NEWSBLUR.Globals.is_premium && !NEWSBLUR.Globals.is_archive &&
|
||||
$.make('div', { className: 'NB-discover-empty' }, [
|
||||
'Only recent stories shown.',
|
||||
'Only recent stories shown from ' + discover_indexed_count + ' of ' + feed_count + ' sites.',
|
||||
$.make('br'),
|
||||
'All related stories are available to Premium Archive subscribers.',
|
||||
$.make('div', {
|
||||
|
|
Loading…
Add table
Reference in a new issue