mirror of https://gitlab.com/bashrc2/epicyon
Avoid duplicates
parent
3261b41abf
commit
12c0c64d96
7
posts.py
7
posts.py
|
@ -3458,6 +3458,7 @@ def _createBoxIndexed(recentPostsCache: {},
|
||||||
}
|
}
|
||||||
|
|
||||||
postsInBox = []
|
postsInBox = []
|
||||||
|
postUrlsInBox = []
|
||||||
|
|
||||||
indexFilename = \
|
indexFilename = \
|
||||||
acctDir(baseDir, timelineNickname, originalDomain) + \
|
acctDir(baseDir, timelineNickname, originalDomain) + \
|
||||||
|
@ -3497,6 +3498,9 @@ def _createBoxIndexed(recentPostsCache: {},
|
||||||
postFilename.replace('\n', '').replace('\r', '')
|
postFilename.replace('\n', '').replace('\r', '')
|
||||||
postUrl = postUrl.replace('.json', '').strip()
|
postUrl = postUrl.replace('.json', '').strip()
|
||||||
|
|
||||||
|
if url in postUrlsInBox:
|
||||||
|
continue
|
||||||
|
|
||||||
# is the post cached in memory?
|
# is the post cached in memory?
|
||||||
if recentPostsCache.get('index'):
|
if recentPostsCache.get('index'):
|
||||||
if postUrl in recentPostsCache['index']:
|
if postUrl in recentPostsCache['index']:
|
||||||
|
@ -3507,6 +3511,7 @@ def _createBoxIndexed(recentPostsCache: {},
|
||||||
boxActor):
|
boxActor):
|
||||||
totalPostsCount += 1
|
totalPostsCount += 1
|
||||||
postsAddedToTimeline += 1
|
postsAddedToTimeline += 1
|
||||||
|
postUrlsInBox.append(url)
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
print('Post not added to timeline')
|
print('Post not added to timeline')
|
||||||
|
@ -3524,6 +3529,7 @@ def _createBoxIndexed(recentPostsCache: {},
|
||||||
postsInBox, boxActor):
|
postsInBox, boxActor):
|
||||||
postsAddedToTimeline += 1
|
postsAddedToTimeline += 1
|
||||||
totalPostsCount += 1
|
totalPostsCount += 1
|
||||||
|
postUrlsInBox.append(url)
|
||||||
else:
|
else:
|
||||||
print('WARN: Unable to add post ' + postUrl +
|
print('WARN: Unable to add post ' + postUrl +
|
||||||
' nickname ' + nickname +
|
' nickname ' + nickname +
|
||||||
|
@ -3539,6 +3545,7 @@ def _createBoxIndexed(recentPostsCache: {},
|
||||||
postsInBox, boxActor):
|
postsInBox, boxActor):
|
||||||
postsAddedToTimeline += 1
|
postsAddedToTimeline += 1
|
||||||
totalPostsCount += 1
|
totalPostsCount += 1
|
||||||
|
postUrlsInBox.append(url)
|
||||||
else:
|
else:
|
||||||
print('WARN: Unable to add features post ' +
|
print('WARN: Unable to add features post ' +
|
||||||
postUrl + ' nickname ' + nickname +
|
postUrl + ' nickname ' + nickname +
|
||||||
|
|
Loading…
Reference in New Issue