mirror of
https://github.com/viq/NewsBlur.git
synced 2025-08-05 16:49:45 +00:00
Concating dupe stories
This commit is contained in:
parent
74bb1ebd4b
commit
7e6aad7b6d
1 changed files with 4 additions and 1 deletions
|
@ -1455,6 +1455,7 @@ class Feed(models.Model):
|
|||
def query_popularity(cls, query, limit, order='newest'):
|
||||
popularity = {}
|
||||
seen_feeds = set()
|
||||
feed_title_to_id = dict()
|
||||
|
||||
# Collect stories, sort by feed
|
||||
story_ids = SearchStory.global_query(query, order=order, offset=0, limit=limit)
|
||||
|
@ -1463,7 +1464,9 @@ class Feed(models.Model):
|
|||
feed = Feed.get_by_id(feed_id)
|
||||
if not feed: continue
|
||||
if feed.feed_title in seen_feeds:
|
||||
continue
|
||||
feed_id = feed_title_to_id[feed.feed_title]
|
||||
else:
|
||||
feed_title_to_id[feed.feed_title] = feed_id
|
||||
seen_feeds.add(feed.feed_title)
|
||||
if feed_id not in popularity:
|
||||
popularity[feed_id] = {
|
||||
|
|
Loading…
Add table
Reference in a new issue