remotes/1693045480750635534/spooky-22
Aevann1 2021-09-27 02:11:59 +02:00
parent 2e5c729e1c
commit 91178ae77e
1 changed files with 6 additions and 11 deletions

View File

@ -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)