From 91178ae77e74751c996afae8b0e78c1a4746a5ae Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 27 Sep 2021 02:11:59 +0200 Subject: [PATCH] fds --- files/routes/front.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 6f8f34c8f9..53f5ef9345 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -160,17 +160,12 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words=' posts = posts.filter(Submission.created_utc >= cutoff) elif t != 'all': now = int(time.time()) - if t == 'hour': - cutoff = now - 3600 - elif t == 'day': - cutoff = now - 86400 - elif t == 'week': - cutoff = now - 604800 - elif t == 'month': - cutoff = now - 2592000 - elif t == 'year': - cutoff = now - 31536000 - if cutoff: posts = posts.filter(Submission.created_utc >= cutoff) + if t == 'hour': cutoff = now - 3600 + elif t == 'week': cutoff = now - 604800 + elif t == 'month': cutoff = now - 2592000 + elif t == 'year': cutoff = now - 31536000 + else: cutoff = now - 86400 + posts = posts.filter(Submission.created_utc >= cutoff) posts = posts.filter_by(is_banned=False, stickied=None, private=False, deleted_utc = 0)