From 44d48edbc08a3f5db6044cc7557d0d4a29d99f6d Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 25 Oct 2020 12:57:14 +0000 Subject: [PATCH] Check number of tags --- newsdaemon.py | 2 +- newswire.py | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/newsdaemon.py b/newsdaemon.py index 7a31d2a40..2147fc73b 100644 --- a/newsdaemon.py +++ b/newsdaemon.py @@ -622,7 +622,7 @@ def convertRSStoActivityPub(baseDir: str, httpPrefix: str, } blog['object']['tag'].append(newTag) hashtagHtml = \ - "#" + \ htId + "" diff --git a/newswire.py b/newswire.py index e044f8a12..cc2eb538e 100644 --- a/newswire.py +++ b/newswire.py @@ -102,12 +102,13 @@ def addNewswireDictEntry(baseDir: str, domain: str, postTags = getNewswireTags(allText, maxTags) # combine the tags into a single list - for tag in postTags: - if tag not in tags: - tags.append(tag) + for tag in tags: + if tag not in postTags: + if len(postTags) < maxTags: + postTags.append(tag) # check that no tags are blocked - for tag in tags: + for tag in postTags: if isBlockedHashtag(baseDir, tag.replace('#', '')): return @@ -118,7 +119,7 @@ def addNewswireDictEntry(baseDir: str, domain: str, postFilename, description, moderated, - tags, + postTags, mirrored ]