sdfsfd
This commit is contained in:
parent
5d7961d629
commit
29a4b7726e
1 changed files with 7 additions and 4 deletions
|
@ -116,7 +116,7 @@ def front_all(v):
|
|||
|
||||
if not v and request.path == "/" and not request.headers.get("Authorization"): return redirect(f"/logged_out{request.full_path}")
|
||||
|
||||
if v and "logged_out" in request.full_path: v = None
|
||||
if v and request.path.startswith('/logged_out'): v = None
|
||||
|
||||
try: page = int(request.values.get("page") or 1)
|
||||
except: abort(400)
|
||||
|
@ -208,11 +208,14 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words='
|
|||
elif sort == "comments":
|
||||
posts = posts.order_by(Submission.comment_count.desc())
|
||||
|
||||
posts = posts.offset(25 * (page - 1)).limit(26).all()
|
||||
if v: size = v.frontsize
|
||||
else: size = 25
|
||||
|
||||
next_exists = (len(posts) > 25)
|
||||
posts = posts.offset(size * (page - 1)).limit(size+1).all()
|
||||
|
||||
posts = posts[:25]
|
||||
next_exists = (len(posts) > size)
|
||||
|
||||
posts = posts[:size]
|
||||
|
||||
if page == 1: posts = g.db.query(Submission.id).options(lazyload('*')).filter(Submission.stickied != None).all() + posts
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue