From 5a695d689db3bdb36c73449aca3032922a5bc568 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 27 Nov 2020 19:52:01 +0000 Subject: [PATCH] Set news flag on blog posts --- posts.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/posts.py b/posts.py index 855793ff..3384a564 100644 --- a/posts.py +++ b/posts.py @@ -580,8 +580,16 @@ def savePostToBox(baseDir: str, httpPrefix: str, postId: str, postJsonObject['object']['id'] = postId postJsonObject['object']['atomUri'] = postId + # for blog posts set the news flag + if postId and postJsonObject['object'].get('type'): + if boxname == 'tlblogs' and \ + postJsonObject['object']['type'] == 'Article': + if '://' + originalDomain + '/' in postId: + postJsonObject['news'] = True + boxDir = createPersonDir(nickname, domain, baseDir, boxname) filename = boxDir + '/' + postId.replace('/', '#') + '.json' + saveJson(postJsonObject, filename) return filename