From e414a3bd5e2e4a7240c1e050c5c64ec039f51b32 Mon Sep 17 00:00:00 2001 From: bashrc Date: Thu, 7 May 2026 15:27:20 +0100 Subject: [PATCH] c2s and s2s image attachment debug --- posts.py | 12 ++++++++++++ scripts/images | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/posts.py b/posts.py index 0539612ce..462aa786b 100644 --- a/posts.py +++ b/posts.py @@ -1401,6 +1401,9 @@ def _create_post_s2s(base_dir: str, nickname: str, domain: str, port: int, if locn_url: new_post['object']['location']['url'] = locn_url if attach_image_filename: + if debug: + print('DEBUG: creating s2s post with attached media ' + + attach_image_filename) new_post['object'] = \ attach_media(base_dir, http_prefix, nickname, domain, port, new_post['object'], attach_image_filename, @@ -1408,6 +1411,9 @@ def _create_post_s2s(base_dir: str, nickname: str, domain: str, port: int, city, low_bandwidth, media_license_url, media_creator, system_language, debug) + else: + if debug: + print('DEBUG: creating s2s post with no attached media') _attach_post_license(new_post['object'], content_license_url) _attach_buy_link(new_post['object'], buy_url, translate) _attach_chat_link(new_post['object'], chat_url) @@ -1569,6 +1575,9 @@ def _create_post_c2s(base_dir: str, nickname: str, domain: str, port: int, new_post['object']['location']['url'] = locn_url if attach_image_filename: + if debug: + print('DEBUG: creating c2s post with attached media ' + + attach_image_filename) new_post = \ attach_media(base_dir, http_prefix, nickname, domain, port, new_post, attach_image_filename, @@ -1576,6 +1585,9 @@ def _create_post_c2s(base_dir: str, nickname: str, domain: str, port: int, city, low_bandwidth, media_license_url, media_creator, system_language, debug) + else: + if debug: + print('DEBUG: creating c2s post with no attached media') _attach_post_license(new_post, content_license_url) _attach_buy_link(new_post, buy_url, translate) _attach_chat_link(new_post, chat_url) diff --git a/scripts/images b/scripts/images index a313ac437..bbafa804a 100755 --- a/scripts/images +++ b/scripts/images @@ -1,5 +1,5 @@ #!/bin/bash -journalctl -u epicyon | grep 'image binary\|favicon is not an image\|image size before\|watermark failed\|image metadata removal\|media saved to\|failed to restore backup image\|failed to rename image\|media could not be saved to\|failed to delete backup image\|post_message_to_outbox unable to rename\|rename image upload\|uploaded image saved to\|uploaded image not saved\|final uploaded image size' > .image.txt +journalctl -u epicyon | grep 'image binary\|favicon is not an image\|image size before\|watermark failed\|image metadata removal\|media saved to\|failed to restore backup image\|failed to rename image\|media could not be saved to\|failed to delete backup image\|post_message_to_outbox unable to rename\|rename image upload\|uploaded image saved to\|uploaded image not saved\|final uploaded image size\|creating s2s post with no attached media\|creating c2s post with no attached media\|creating s2s post with attached media\|creating c2s post with attached media' > .image.txt if [ ! -f .image.txt ]; then echo 'No image warnings' else