fds
parent
2e5c729e1c
commit
91178ae77e
|
@ -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)
|
posts = posts.filter(Submission.created_utc >= cutoff)
|
||||||
elif t != 'all':
|
elif t != 'all':
|
||||||
now = int(time.time())
|
now = int(time.time())
|
||||||
if t == 'hour':
|
if t == 'hour': cutoff = now - 3600
|
||||||
cutoff = now - 3600
|
elif t == 'week': cutoff = now - 604800
|
||||||
elif t == 'day':
|
elif t == 'month': cutoff = now - 2592000
|
||||||
cutoff = now - 86400
|
elif t == 'year': cutoff = now - 31536000
|
||||||
elif t == 'week':
|
else: cutoff = now - 86400
|
||||||
cutoff = now - 604800
|
posts = posts.filter(Submission.created_utc >= cutoff)
|
||||||
elif t == 'month':
|
|
||||||
cutoff = now - 2592000
|
|
||||||
elif t == 'year':
|
|
||||||
cutoff = now - 31536000
|
|
||||||
if cutoff: posts = posts.filter(Submission.created_utc >= cutoff)
|
|
||||||
|
|
||||||
posts = posts.filter_by(is_banned=False, stickied=None, private=False, deleted_utc = 0)
|
posts = posts.filter_by(is_banned=False, stickied=None, private=False, deleted_utc = 0)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue