diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2018-11-10 16:24:03 +0100 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2018-11-10 16:24:03 +0100 |
commit | 2791b7b8a58fd5b535c2c65599653f7adb9e71de (patch) | |
tree | da1cba3b516fecd89bb7cbf667d620439b4f7e15 /src/web/views/views.py | |
parent | Updated dependencies. (diff) | |
parent | Merge branch 'master' of gitlab.com:newspipe/newspipe (diff) | |
download | newspipe-2791b7b8a58fd5b535c2c65599653f7adb9e71de.tar.gz newspipe-2791b7b8a58fd5b535c2c65599653f7adb9e71de.tar.bz2 newspipe-2791b7b8a58fd5b535c2c65599653f7adb9e71de.zip |
Merge branch 'master' of gitlab.com:newspipe/newspipe
Diffstat (limited to 'src/web/views/views.py')
-rw-r--r-- | src/web/views/views.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/web/views/views.py b/src/web/views/views.py index b0e8266b..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: @@ -68,6 +71,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) |