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,6 +553,7 @@ def getPostsForBlockedDomains(baseDir: str,
if not blockedPosts.get(postDomain): if not blockedPosts.get(postDomain):
blockedPosts[postDomain] = [url] blockedPosts[postDomain] = [url]
else: else:
if url not in blockedPosts[postDomain]:
blockedPosts[postDomain].append(url) blockedPosts[postDomain].append(url)
if item['object'].get('tag'): if item['object'].get('tag'):
@ -568,6 +569,7 @@ def getPostsForBlockedDomains(baseDir: str,
if not blockedPosts.get(postDomain): if not blockedPosts.get(postDomain):
blockedPosts[postDomain] = [url] blockedPosts[postDomain] = [url]
else: else:
if url not in blockedPosts[postDomain]:
blockedPosts[postDomain].append(url) blockedPosts[postDomain].append(url)
return blockedPosts return blockedPosts