mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
Counting dupe feeds only once in unread counts.
This commit is contained in:
parent
4f7ddacb87
commit
22de79a0d7
1 changed files with 5 additions and 3 deletions
|
@ -252,15 +252,17 @@ NEWSBLUR.Collections.Folders = Backbone.Collection.extend({
|
|||
});
|
||||
},
|
||||
|
||||
unread_counts: function(sum_total) {
|
||||
unread_counts: function(sum_total, seen_feeds) {
|
||||
if (!seen_feeds) seen_feeds = [];
|
||||
var counts = this.reduce(function(counts, item) {
|
||||
if (item.is_feed()) {
|
||||
if (item.is_feed() && !_.contains(seen_feeds, item.feed.id)) {
|
||||
var feed_counts = item.feed.unread_counts();
|
||||
counts['ps'] += feed_counts['ps'];
|
||||
counts['nt'] += feed_counts['nt'];
|
||||
counts['ng'] += feed_counts['ng'];
|
||||
seen_feeds.push(item.feed.id);
|
||||
} else if (item.is_folder()) {
|
||||
var folder_counts = item.folders.unread_counts();
|
||||
var folder_counts = item.folders.unread_counts(false, seen_feeds);
|
||||
counts['ps'] += folder_counts['ps'];
|
||||
counts['nt'] += folder_counts['nt'];
|
||||
counts['ng'] += folder_counts['ng'];
|
||||
|
|
Loading…
Add table
Reference in a new issue