From 7195fd1416654d7ca3fdfea614f413ff73509216 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 2 Oct 2021 02:02:57 +0200 Subject: [PATCH] dsf --- files/routes/front.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 96ce00ad9..5766ba109 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -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 request.path.startswith('/logged_out'): v = None + if v and "logged_out" in request.full_path: v = None try: page = int(request.values.get("page") or 1) except: abort(400) @@ -208,13 +208,11 @@ 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()) - size = 25 + posts = posts.offset(25 * (page - 1)).limit(26).all() - posts = posts.offset(size * (page - 1)).limit(size+1).all() + next_exists = (len(posts) > 25) - next_exists = (len(posts) > size) - - posts = posts[:size] + posts = posts[:25] if page == 1: posts = g.db.query(Submission.id).options(lazyload('*')).filter(Submission.stickied != None).all() + posts