fsd
This commit is contained in:
parent
854107045d
commit
2be04b0d1d
1 changed files with 3 additions and 3 deletions
|
@ -112,7 +112,7 @@ def notifications(v):
|
||||||
@cache.memoize(timeout=86400)
|
@cache.memoize(timeout=86400)
|
||||||
def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words='', **kwargs):
|
def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words='', **kwargs):
|
||||||
|
|
||||||
posts = g.db.query(Submission.id).options(lazyload('*'))
|
posts = g.db.query(Submission).options(lazyload('*'))
|
||||||
|
|
||||||
if 'rdrama' in request.host and t != 'day' and sort in ["hot","controversial"]:
|
if 'rdrama' in request.host and t != 'day' and sort in ["hot","controversial"]:
|
||||||
cutoff = int(time.time()) - 86400
|
cutoff = int(time.time()) - 86400
|
||||||
|
@ -195,9 +195,9 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words='
|
||||||
|
|
||||||
posts = posts[:25]
|
posts = posts[:25]
|
||||||
|
|
||||||
if page == 1: posts = g.db.query(Submission.id).options(lazyload('*')).filter(Submission.stickied != None).all() + posts
|
if page == 1: posts = g.db.query(Submission).options(lazyload('*')).filter(Submission.stickied != None).all() + posts
|
||||||
|
|
||||||
if ids_only: posts = [x[0] for x in posts]
|
if ids_only: posts = [x.id for x in posts]
|
||||||
|
|
||||||
return posts, next_exists
|
return posts, next_exists
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue