From 9856d34ff4d9a66eeb4adb82ff7d9e8d4026f576 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 11 Apr 2020 13:51:05 +0100 Subject: [PATCH] Increment index on fail --- webinterface.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/webinterface.py b/webinterface.py index d0c3bce9b..6ad502b1f 100644 --- a/webinterface.py +++ b/webinterface.py @@ -757,7 +757,7 @@ def htmlHistorySearch(translate: {}, baseDir: str, historysearch = historysearch.lower().strip('\n') - lines = \ + boxFilenames = \ searchBoxPosts(baseDir, nickname, domain, historysearch, postsPerPage) @@ -776,7 +776,7 @@ def htmlHistorySearch(translate: {}, baseDir: str, historySearchForm += \ '

' + translate['Your Posts'] + '

' - if len(lines) == 0: + if len(boxFilenames) == 0: historySearchForm += \ '
' + translate['No results'] + \ '
' @@ -793,18 +793,19 @@ def htmlHistorySearch(translate: {}, baseDir: str, # get the start end end within the index file startIndex = int((pageNumber - 1) * postsPerPage) endIndex = startIndex + postsPerPage - noOfLines = len(lines) - if endIndex >= noOfLines and noOfLines > 0: - endIndex = noOfLines - 1 + noOfBoxFilenames = len(boxFilenames) + if endIndex >= noOfBoxFilenames and noOfBoxFilenames > 0: + endIndex = noOfBoxFilenames - 1 index = startIndex while index <= endIndex: - postFilename = lines[index] + postFilename = boxFilenames[index] if not postFilename: index += 1 continue postJsonObject = loadJson(postFilename) if not postJsonObject: + index += 1 continue showIndividualPostIcons = True allowDeletion = False