Better check for presence of orderedItems

merge-requests/30/head
Bob Mottram 2021-08-02 11:50:32 +01:00
parent fdbdfaa9b5
commit 5a442c1d3c
2 changed files with 1 additions and 7 deletions

View File

@ -3374,8 +3374,6 @@ 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]
print('Adding post to timeline: ' +
boxname + ' ' + url)
if _addPostStringToTimeline(url, if _addPostStringToTimeline(url,
boxname, postsInBox, boxname, postsInBox,
boxActor): boxActor):
@ -3395,8 +3393,6 @@ def _createBoxIndexed(recentPostsCache: {},
if os.path.isfile(fullPostFilename + '.reject'): if os.path.isfile(fullPostFilename + '.reject'):
continue continue
print('Adding post to timeline: ' +
boxname + ' ' + fullPostFilename)
if _addPostToTimeline(fullPostFilename, boxname, if _addPostToTimeline(fullPostFilename, boxname,
postsInBox, boxActor): postsInBox, boxActor):
postsAddedToTimeline += 1 postsAddedToTimeline += 1
@ -3413,8 +3409,6 @@ def _createBoxIndexed(recentPostsCache: {},
locatePost(baseDir, timelineNickname, locatePost(baseDir, timelineNickname,
originalDomain, postUrl, False) originalDomain, postUrl, False)
if fullPostFilename: if fullPostFilename:
print('Adding post to timeline: ' +
boxname + ' ' + fullPostFilename)
if _addPostToTimeline(fullPostFilename, boxname, if _addPostToTimeline(fullPostFilename, boxname,
postsInBox, boxActor): postsInBox, boxActor):
postsAddedToTimeline += 1 postsAddedToTimeline += 1

View File

@ -738,7 +738,7 @@ def htmlTimeline(cssCache: {}, defaultTimeline: str,
# show the posts # show the posts
itemCtr = 0 itemCtr = 0
if timelineJson: if timelineJson:
if not timelineJson.get('orderedItems'): if 'orderedItems' not in timelineJson:
print('ERROR: no orderedItems in timeline for ' print('ERROR: no orderedItems in timeline for '
+ boxName + ' ' + str(timelineJson)) + boxName + ' ' + str(timelineJson))
return '' return ''