From e4db3ccc4023f29255e82916e6308ab1140b9c4e Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Wed, 23 Oct 2024 14:02:25 +0100 Subject: [PATCH] Create post_url if missing --- utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utils.py b/utils.py index 801d667da..5dc1a35f3 100644 --- a/utils.py +++ b/utils.py @@ -3553,6 +3553,7 @@ def reject_post_id(base_dir: str, nickname: str, domain: str, if not post_filename: return + post_url = None if recent_posts_cache.get('index'): # if this is a full path then remove the directories index_filename = post_filename @@ -3582,6 +3583,9 @@ def reject_post_id(base_dir: str, nickname: str, domain: str, # if the post is in the inbox index then remove it index_file = \ acct_dir(base_dir, nickname, domain) + '/inbox.index' + if not post_url: + post_url = remove_eol(index_filename) + post_url = post_url.replace('.json', '').strip() post_url2 = post_url.replace('/', '#') + '.json' remove_post_from_index(post_url2, debug, index_file)