fds
This commit is contained in:
parent
3f9076342f
commit
7c23eea71c
6 changed files with 31 additions and 12 deletions
|
@ -114,8 +114,10 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words='
|
|||
|
||||
posts = g.db.query(Submission).options(lazyload('*'))
|
||||
|
||||
if t != 'all':
|
||||
cutoff = 0
|
||||
if t != 'day' and sort in ["hot","controversial"]:
|
||||
cutoff = int(time.time()) - 86400
|
||||
posts = posts.filter(Submission.created_utc >= cutoff)
|
||||
elif t != 'all':
|
||||
now = int(time.time())
|
||||
if t == 'hour':
|
||||
cutoff = now - 3600
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue