From 930efafbec1f3c171b092be65799e94312d70409 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 25 Sep 2021 03:43:21 +0200 Subject: [PATCH] fds --- files/routes/front.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 87ea678a5..9f6557bb4 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -153,7 +153,7 @@ def front_all(v): #@cache.memoize(timeout=86400) def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words='', **kwargs): - posts = g.db.query(Submission).options(lazyload('*')) + posts = g.db.query(Submission.id).options(lazyload('*')) if 'rdrama' in request.host and sort == "hot": cutoff = int(time.time()) - 86400 @@ -223,9 +223,9 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words=' posts = posts[:25] - if page == 1: posts = g.db.query(Submission).options(lazyload('*')).filter(Submission.stickied != None).all() + posts + if page == 1: posts = g.db.query(Submission.id).options(lazyload('*')).filter(Submission.stickied != None).all() + posts - if ids_only: posts = [x.id for x in posts] + if ids_only: posts = [x[0] for x in posts] print(posts) return posts, next_exists