Revert "Always test timeline post type"

This reverts commit fc1878d72a.
main
Bob Mottram 2019-11-18 12:40:38 +00:00
parent fc1878d72a
commit 8a29d5510c
1 changed files with 11 additions and 12 deletions

View File

@ -2295,9 +2295,8 @@ def isTimelinePost(filePath: str,boxname: str,postsInBox: []) -> bool:
if '"Create"' in postStr: if '"Create"' in postStr:
if 'mediaType' not in postStr or 'image/' not in postStr: if 'mediaType' not in postStr or 'image/' not in postStr:
return False return False
if postsInBox!=None: # add the post to the dictionary
# add the post to the dictionary postsInBox.append(postStr)
postsInBox.append(postStr)
return True return True
return False return False
@ -2369,24 +2368,24 @@ def createBoxIndexed(session,baseDir: str,boxname: str, \
with open(indexFilename, 'r') as indexFile: with open(indexFilename, 'r') as indexFile:
while postsCtr<maxPostCtr: while postsCtr<maxPostCtr:
postFilename=indexFile.readline() postFilename=indexFile.readline()
# Skip through any posts previous to the current page
if postsCtr<int((pageNumber-1)*itemsPerPage):
if postFilename:
postsCtr+=1
continue
if not postFilename: if not postFilename:
continue continue
postOnThisTimeline=False
# filename of the post without any extension or path # filename of the post without any extension or path
postUrl=postFilename.replace('\n','').replace('.json','') postUrl=postFilename.replace('\n','').replace('.json','')
# get the full path of the post # get the full path of the post
fullPostFilename= \ fullPostFilename= \
locatePost(baseDir,nickname,domain,postUrl,False) locatePost(baseDir,nickname,domain,postUrl,False)
if fullPostFilename: if fullPostFilename:
if postsCtr<int((pageNumber-1)*itemsPerPage): if not isTimelinePost(fullPostFilename,boxname,postsInBox):
if isTimelinePost(fullPostFilename,boxname,None): continue
postOnThisTimeline=True
else:
if isTimelinePost(fullPostFilename,boxname,postsInBox):
postOnThisTimeline=True
if postOnThisTimeline:
postsCtr+=1 postsCtr+=1
# Generate first and last entries within header # Generate first and last entries within header