Fixing new stories coming into dashboard being filtered out incorrectly.

This commit is contained in:
Samuel Clay 2021-02-03 20:05:59 -05:00
parent cd90b968fd
commit e8fb94af23
3 changed files with 10 additions and 12 deletions

View file

@ -859,9 +859,6 @@ hr {
opacity: 1;
}
*/
.NB-feedlist .folder.NB-selected > .folder_title .feed_counts_floater {
margin-right: 24px;
}
.NB-feedlist .feed.NB-toplevel:hover .feed_favicon {
display: none;

View file

@ -90,7 +90,7 @@ NEWSBLUR.Views.DashboardRiver = Backbone.View.extend({
this.$(".NB-module-river-settings").html($options);
},
feeds: function () {
feeds: function (include_read) {
var river_id = this.model.get('river_id');
if (_.string.startsWith(river_id, 'feed:')) {
@ -107,13 +107,13 @@ NEWSBLUR.Views.DashboardRiver = Backbone.View.extend({
var feeds;
var visible_only = NEWSBLUR.assets.view_setting(river_id, 'read_filter') == 'unread';
if (visible_only) {
if (visible_only && !include_read) {
feeds = _.pluck(active_folder.feeds_with_unreads(), 'id');
}
if (!feeds || !feeds.length) {
feeds = active_folder.feed_ids_in_folder();
}
console.log(['River feeds', river_id, feeds.length, feeds]);
return feeds;
},
@ -338,16 +338,17 @@ NEWSBLUR.Views.DashboardRiver = Backbone.View.extend({
if (feed_stories_per_month > NEWSBLUR.assets.preference('infrequent_stories_per_month')) {
return;
}
}
if (this.options.global_feed) {
} else if (this.options.global_feed) {
// Global Shared Stories don't come in real-time (yet)
return;
} else if (!_.contains(this.feeds(true), parseInt(feed_id, 10))) {
console.log(['New story not in folder', this.model.get('river_id'), feed_id, this.feeds()]);
return;
}
var subs = feed.get('num_subscribers');
var delay = subs * 2; // 1,000 subs = 2 seconds
console.log(['Fetching dashboard story', story_hash, delay + 'ms delay']);
console.log(['Fetching dashboard story', this.model.get('river_id'), story_hash, delay + 'ms delay']);
_.delay(_.bind(function() {
NEWSBLUR.assets.add_dashboard_story(story_hash, this.options.dashboard_stories);

View file

@ -144,7 +144,7 @@ def pre_process_story(entry, encoding):
if 'summary_detail' in entry and entry['summary_detail'].get('type', None) == 'text/plain':
try:
entry['story_content'] = feedparser._sanitizeHTML(entry['story_content'], encoding, 'text/plain')
entry['story_content'] = feedparser.sanitizer._sanitize_html(entry['story_content'], encoding, 'text/plain')
if encoding and not isinstance(entry['story_content'], str):
entry['story_content'] = entry['story_content'].decode(encoding, 'ignore')
except UnicodeEncodeError: