mirror of https://gitlab.com/bashrc2/epicyon
Ensure that items are counted as being added to the timeline
parent
429044c937
commit
b18d5b6242
23
posts.py
23
posts.py
|
@ -3146,7 +3146,6 @@ def _createBoxIndexed(recentPostsCache: {},
|
||||||
'/' + indexBoxName + '.index'
|
'/' + indexBoxName + '.index'
|
||||||
postsCtr = 0
|
postsCtr = 0
|
||||||
if os.path.isfile(indexFilename):
|
if os.path.isfile(indexFilename):
|
||||||
maxPostCtr = itemsPerPage * pageNumber
|
|
||||||
with open(indexFilename, 'r') as indexFile:
|
with open(indexFilename, 'r') as indexFile:
|
||||||
postsAddedToTimeline = 0
|
postsAddedToTimeline = 0
|
||||||
while postsAddedToTimeline < itemsPerPage:
|
while postsAddedToTimeline < itemsPerPage:
|
||||||
|
@ -3214,11 +3213,11 @@ def _createBoxIndexed(recentPostsCache: {},
|
||||||
if postUrl in recentPostsCache['index']:
|
if postUrl in recentPostsCache['index']:
|
||||||
if recentPostsCache['json'].get(postUrl):
|
if recentPostsCache['json'].get(postUrl):
|
||||||
url = recentPostsCache['json'][postUrl]
|
url = recentPostsCache['json'][postUrl]
|
||||||
_addPostStringToTimeline(url,
|
if _addPostStringToTimeline(url,
|
||||||
boxname, postsInBox,
|
boxname, postsInBox,
|
||||||
boxActor)
|
boxActor):
|
||||||
postsCtr += 1
|
postsCtr += 1
|
||||||
postsAddedToTimeline +=1
|
postsAddedToTimeline += 1
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# read the post from file
|
# read the post from file
|
||||||
|
@ -3226,9 +3225,10 @@ def _createBoxIndexed(recentPostsCache: {},
|
||||||
locatePost(baseDir, nickname,
|
locatePost(baseDir, nickname,
|
||||||
domain, postUrl, False)
|
domain, postUrl, False)
|
||||||
if fullPostFilename:
|
if fullPostFilename:
|
||||||
_addPostToTimeline(fullPostFilename, boxname,
|
if _addPostToTimeline(fullPostFilename, boxname,
|
||||||
postsInBox, boxActor)
|
postsInBox, boxActor):
|
||||||
postsAddedToTimeline +=1
|
postsAddedToTimeline += 1
|
||||||
|
postsCtr += 1
|
||||||
else:
|
else:
|
||||||
if timelineNickname != nickname:
|
if timelineNickname != nickname:
|
||||||
# if this is the features timeline
|
# if this is the features timeline
|
||||||
|
@ -3236,9 +3236,10 @@ def _createBoxIndexed(recentPostsCache: {},
|
||||||
locatePost(baseDir, timelineNickname,
|
locatePost(baseDir, timelineNickname,
|
||||||
domain, postUrl, False)
|
domain, postUrl, False)
|
||||||
if fullPostFilename:
|
if fullPostFilename:
|
||||||
_addPostToTimeline(fullPostFilename, boxname,
|
if _addPostToTimeline(fullPostFilename, boxname,
|
||||||
postsInBox, boxActor)
|
postsInBox, boxActor):
|
||||||
postsAddedToTimeline +=1
|
postsAddedToTimeline += 1
|
||||||
|
postsCtr += 1
|
||||||
else:
|
else:
|
||||||
print('WARN: features timeline. ' +
|
print('WARN: features timeline. ' +
|
||||||
'Unable to locate post ' + postUrl)
|
'Unable to locate post ' + postUrl)
|
||||||
|
@ -3246,8 +3247,6 @@ def _createBoxIndexed(recentPostsCache: {},
|
||||||
print('WARN: Unable to locate post ' + postUrl +
|
print('WARN: Unable to locate post ' + postUrl +
|
||||||
' nickname ' + nickname)
|
' nickname ' + nickname)
|
||||||
|
|
||||||
postsCtr += 1
|
|
||||||
|
|
||||||
# Generate first and last entries within header
|
# Generate first and last entries within header
|
||||||
if postsCtr > 0:
|
if postsCtr > 0:
|
||||||
lastPage = int(postsCtr / itemsPerPage)
|
lastPage = int(postsCtr / itemsPerPage)
|
||||||
|
|
Loading…
Reference in New Issue