Fix the counting of posts

main2
Bob Mottram 2019-09-24 22:56:53 +01:00
parent a117b21009
commit 70a9fb0929
1 changed files with 6 additions and 5 deletions

View File

@ -1857,11 +1857,11 @@ def createBoxBase(baseDir: str,boxname: str, \
isPost=False isPost=False
if isPost: if isPost:
isTimelinePost=False
if currPage == pageNumber and postsOnPageCtr <= itemsPerPage: if currPage == pageNumber and postsOnPageCtr <= itemsPerPage:
# get the post as json # get the post as json
p = json.loads(postStr) p = json.loads(postStr)
isTimelinePost=False
if (boxname!='dm' and boxname!='tlreplies'): if (boxname!='dm' and boxname!='tlreplies'):
isTimelinePost=True isTimelinePost=True
else: else:
@ -1903,10 +1903,11 @@ def createBoxBase(baseDir: str,boxname: str, \
if postsOnPageCtr >= itemsPerPage: if postsOnPageCtr >= itemsPerPage:
break break
# count the pages # count the pages
postsCtr += 1 if isTimelinePost:
if postsCtr >= itemsPerPage: postsCtr += 1
postsCtr = 0 if postsCtr >= itemsPerPage:
currPage += 1 postsCtr = 0
currPage += 1
except Exception as e: except Exception as e:
print(e) print(e)
if headerOnly: if headerOnly: