aboutsummaryrefslogtreecommitdiff
path: root/src/web/views
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2018-11-02 15:50:12 +0100
committerCédric Bonhomme <cedric@cedricbonhomme.org>2018-11-02 15:50:12 +0100
commit78e22dae3683a30bba75e78104b5da88efccab9f (patch)
treecde6147f42bb093b9a0220fc5db9c9117ec74303 /src/web/views
parentIgnore feeds with too much errors when calculating most popular feeds. (diff)
downloadnewspipe-78e22dae3683a30bba75e78104b5da88efccab9f.tar.gz
newspipe-78e22dae3683a30bba75e78104b5da88efccab9f.tar.bz2
newspipe-78e22dae3683a30bba75e78104b5da88efccab9f.zip
Offers more filtering possibilities on the popular feeds view for the user
Diffstat (limited to 'src/web/views')
-rw-r--r--src/web/views/views.py5
1 files changed, 4 insertions, 1 deletions
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:
bgstack15