mirror of https://gitlab.com/bashrc2/epicyon
Always test timeline post type
parent
e97e223ecb
commit
fc1878d72a
19
posts.py
19
posts.py
|
@ -2295,6 +2295,7 @@ def isTimelinePost(filePath: str,boxname: str,postsInBox: []) -> bool:
|
|||
if '"Create"' in postStr:
|
||||
if 'mediaType' not in postStr or 'image/' not in postStr:
|
||||
return False
|
||||
if postsInBox!=None:
|
||||
# add the post to the dictionary
|
||||
postsInBox.append(postStr)
|
||||
return True
|
||||
|
@ -2368,24 +2369,24 @@ def createBoxIndexed(session,baseDir: str,boxname: str, \
|
|||
with open(indexFilename, 'r') as indexFile:
|
||||
while postsCtr<maxPostCtr:
|
||||
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:
|
||||
continue
|
||||
|
||||
postOnThisTimeline=False
|
||||
# filename of the post without any extension or path
|
||||
postUrl=postFilename.replace('\n','').replace('.json','')
|
||||
# get the full path of the post
|
||||
fullPostFilename= \
|
||||
locatePost(baseDir,nickname,domain,postUrl,False)
|
||||
if fullPostFilename:
|
||||
if not isTimelinePost(fullPostFilename,boxname,postsInBox):
|
||||
continue
|
||||
if postsCtr<int((pageNumber-1)*itemsPerPage):
|
||||
if isTimelinePost(fullPostFilename,boxname,None):
|
||||
postOnThisTimeline=True
|
||||
else:
|
||||
if isTimelinePost(fullPostFilename,boxname,postsInBox):
|
||||
postOnThisTimeline=True
|
||||
|
||||
if postOnThisTimeline:
|
||||
postsCtr+=1
|
||||
|
||||
# Generate first and last entries within header
|
||||
|
|
Loading…
Reference in New Issue