mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-08-05 16:58:59 +00:00
Showing 5 distinct related feeds in title bar.
This commit is contained in:
parent
914d07d51e
commit
1bd3de276f
2 changed files with 4 additions and 1 deletions
1
Makefile
1
Makefile
|
@ -179,6 +179,7 @@ monitor: deploy_monitor
|
|||
deploy_staging:
|
||||
ansible-playbook ansible/deploy.yml -l staging
|
||||
staging: deploy_staging
|
||||
deploy_staging_static: staging_static
|
||||
staging_static:
|
||||
ansible-playbook ansible/deploy.yml -l staging --tags static
|
||||
celery_stop:
|
||||
|
|
|
@ -1073,13 +1073,15 @@ class Feed(models.Model):
|
|||
feed_ids = [result["_source"]["feed_id"] for result in results]
|
||||
similar_feeds = Feed.objects.filter(pk__in=feed_ids).distinct("feed_title")
|
||||
try:
|
||||
self.similar_feeds.set(feed_ids)
|
||||
self.similar_feeds.set(similar_feeds)
|
||||
except IntegrityError:
|
||||
logging.debug(f" ---> ~FRIntegrity error adding similar feed: {feed_ids}")
|
||||
pass
|
||||
else:
|
||||
feed_ids = [result["_source"]["feed_id"] for result in results]
|
||||
similar_feeds = Feed.objects.filter(pk__in=feed_ids).distinct("feed_title")
|
||||
if self.similar_feeds.count() < 5:
|
||||
self.similar_feeds.add(*similar_feeds[: 5 - self.similar_feeds.count()])
|
||||
return similar_feeds
|
||||
|
||||
@classmethod
|
||||
|
|
Loading…
Add table
Reference in a new issue