From 8f1700a3c5f2aaf5ca362f8a95cacc7ca092f3e6 Mon Sep 17 00:00:00 2001 From: justcool393 Date: Sun, 6 Nov 2022 02:31:28 -0600 Subject: [PATCH] WPD: front: partially fix next page bug (increase counter to 101 so that we know about any next pages) - the next page but still is there but this may fix it in some cases WPD: front: fix bug that makes posts not show up when viewing a hole --- files/routes/front.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 75478c5c6..fdf8bf59c 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -141,15 +141,14 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, ccmode="false" if v: size = v.frontsize or 0 else: size = PAGE_SIZE - if SITE_NAME == 'WPD' and sort == "hot": - posts = posts.offset(size * (page - 1)).limit(100).all() + if SITE_NAME == 'WPD' and sort == "hot" and sub == None: + posts = posts.offset(size * (page - 1)).limit(101).all() to_remove = [x.id for x in posts if x.sub == 'social'][1:] + [x.id for x in posts if x.sub == 'music'][1:] posts = [x for x in posts if x.id not in to_remove] else: posts = posts.offset(size * (page - 1)).limit(size+1).all() next_exists = (len(posts) > size) - posts = posts[:size] if pins and page == 1 and ccmode == "false" and not gt and not lt: