Deduplicate blocked posts list

main
Bob Mottram 2020-12-17 11:11:31 +00:00
parent db98be75dd
commit 18e572e21f
1 changed files with 4 additions and 2 deletions

View File

@ -553,7 +553,8 @@ def getPostsForBlockedDomains(baseDir: str,
if not blockedPosts.get(postDomain):
blockedPosts[postDomain] = [url]
else:
blockedPosts[postDomain].append(url)
if url not in blockedPosts[postDomain]:
blockedPosts[postDomain].append(url)
if item['object'].get('tag'):
for tagItem in item['object']['tag']:
@ -568,7 +569,8 @@ def getPostsForBlockedDomains(baseDir: str,
if not blockedPosts.get(postDomain):
blockedPosts[postDomain] = [url]
else:
blockedPosts[postDomain].append(url)
if url not in blockedPosts[postDomain]:
blockedPosts[postDomain].append(url)
return blockedPosts