From 9ae3f23383119fa2367c297ce485917236abfa6e Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 20 Oct 2019 15:11:56 +0100 Subject: [PATCH] Set minimum number of index pages to load --- posts.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/posts.py b/posts.py index b6010b73..13945736 100644 --- a/posts.py +++ b/posts.py @@ -2037,7 +2037,10 @@ def createBoxBase(session,baseDir: str,boxname: str, \ postsCtr=0 maxPostCtr=None if pageNumber: - maxPostCtr=(itemsPerPage+3)*pageNumber + minPageNumber=pageNumber + if minPageNumber<3: + minPageNumber=3 + maxPostCtr=itemsPerPage*minPageNumber with open(indexFilename, 'r') as indexFile: for postFilename in indexFile: postsInBox[postsCtr]=os.path.join(boxDir, postFilename.replace('\n',''))