From d6256b67a5ab6ee65b68061561b204344b3ce84d Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Fri, 2 Nov 2018 15:34:08 +0100 Subject: Ignore feeds with too much errors when calculating most popular feeds. --- src/web/views/views.py | 1 + 1 file changed, 1 insertion(+) (limited to 'src/web/views/views.py') diff --git a/src/web/views/views.py b/src/web/views/views.py index b0e8266b..ff442319 100644 --- a/src/web/views/views.py +++ b/src/web/views/views.py @@ -68,6 +68,7 @@ def popular(): filters = {} filters['created_date__gt'] = not_added_before filters['private'] = False + filters['error_count__lt'] = conf.DEFAULT_MAX_ERROR feeds = FeedController().count_by_link(**filters) sorted_feeds = sorted(list(feeds.items()), key=operator.itemgetter(1), reverse=True) -- cgit From 78e22dae3683a30bba75e78104b5da88efccab9f Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Fri, 2 Nov 2018 15:50:12 +0100 Subject: Offers more filtering possibilities on the popular feeds view for the user --- src/web/views/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/web/views/views.py') diff --git a/src/web/views/views.py b/src/web/views/views.py index ff442319..57f790b1 100644 --- a/src/web/views/views.py +++ b/src/web/views/views.py @@ -56,7 +56,10 @@ def popular(): # try to get the 'recent' popular websites, created after # 'not_created_before' # ie: not_added_before = date_last_added_feed - nb_days - nb_days = int(request.args.get('nb_days', 1000)) + try: + nb_days = int(request.args.get('nb_days', 365)) + except ValueError: + nb_days = 10000 last_added_feed = FeedController().read().\ order_by(desc('created_date')).limit(1).all() if last_added_feed: -- cgit