From 94949289f07e7f915f640b71179b193356fc1d5b Mon Sep 17 00:00:00 2001 From: io Date: Mon, 27 Sep 2021 11:13:03 +0000 Subject: [PATCH] normalize Pleroman posts without cws (fix #3) --- fetch_posts.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fetch_posts.py b/fetch_posts.py index 784d753..c7e8c9b 100755 --- a/fetch_posts.py +++ b/fetch_posts.py @@ -144,7 +144,9 @@ class PostFetcher: """, ( obj['id'], - obj['summary'], + # Pleroma returns an empty string here for posts without a CW, + # which is semantically incorrect IMO + obj['summary'] or None, extract_post_content(obj['content']), pendulum.parse(obj['published']).astimezone(pendulum.timezone('UTC')).timestamp(), ),