More descriptive variable name

main
Bob Mottram 2021-04-30 10:17:22 +01:00
parent bdd428439e
commit 4a2137654f
1 changed files with 9 additions and 9 deletions

View File

@ -3103,7 +3103,7 @@ def _createBoxIndexed(recentPostsCache: {},
indexFilename = \ indexFilename = \
baseDir + '/accounts/' + timelineNickname + '@' + domain + \ baseDir + '/accounts/' + timelineNickname + '@' + domain + \
'/' + indexBoxName + '.index' '/' + indexBoxName + '.index'
postsCtr = 0 totalPostsCount = 0
postsAddedToTimeline = 0 postsAddedToTimeline = 0
if os.path.isfile(indexFilename): if os.path.isfile(indexFilename):
with open(indexFilename, 'r') as indexFile: with open(indexFilename, 'r') as indexFile:
@ -3153,8 +3153,8 @@ def _createBoxIndexed(recentPostsCache: {},
continue continue
# Skip through any posts previous to the current page # Skip through any posts previous to the current page
if postsCtr < int((pageNumber - 1) * itemsPerPage): if totalPostsCount < int((pageNumber - 1) * itemsPerPage):
postsCtr += 1 totalPostsCount += 1
continue continue
# if this is a full path then remove the directories # if this is a full path then remove the directories
@ -3176,7 +3176,7 @@ def _createBoxIndexed(recentPostsCache: {},
if _addPostStringToTimeline(url, if _addPostStringToTimeline(url,
boxname, postsInBox, boxname, postsInBox,
boxActor): boxActor):
postsCtr += 1 totalPostsCount += 1
postsAddedToTimeline += 1 postsAddedToTimeline += 1
continue continue
@ -3192,7 +3192,7 @@ def _createBoxIndexed(recentPostsCache: {},
if _addPostToTimeline(fullPostFilename, boxname, if _addPostToTimeline(fullPostFilename, boxname,
postsInBox, boxActor): postsInBox, boxActor):
postsAddedToTimeline += 1 postsAddedToTimeline += 1
postsCtr += 1 totalPostsCount += 1
else: else:
if timelineNickname != nickname: if timelineNickname != nickname:
# if this is the features timeline # if this is the features timeline
@ -3203,7 +3203,7 @@ def _createBoxIndexed(recentPostsCache: {},
if _addPostToTimeline(fullPostFilename, boxname, if _addPostToTimeline(fullPostFilename, boxname,
postsInBox, boxActor): postsInBox, boxActor):
postsAddedToTimeline += 1 postsAddedToTimeline += 1
postsCtr += 1 totalPostsCount += 1
else: else:
print('WARN: features timeline. ' + print('WARN: features timeline. ' +
'Unable to locate post ' + postUrl) 'Unable to locate post ' + postUrl)
@ -3211,13 +3211,13 @@ def _createBoxIndexed(recentPostsCache: {},
print('WARN: Unable to locate post ' + postUrl + print('WARN: Unable to locate post ' + postUrl +
' nickname ' + nickname) ' nickname ' + nickname)
if postsCtr < 3: if totalPostsCount < 3:
print('Posts added to json timeline ' + boxname + ': ' + print('Posts added to json timeline ' + boxname + ': ' +
str(postsAddedToTimeline)) str(postsAddedToTimeline))
# Generate first and last entries within header # Generate first and last entries within header
if postsCtr > 0: if totalPostsCount > 0:
lastPage = int(postsCtr / itemsPerPage) lastPage = int(totalPostsCount / itemsPerPage)
if lastPage < 1: if lastPage < 1:
lastPage = 1 lastPage = 1
boxHeader['last'] = \ boxHeader['last'] = \