From a940719a349d21b9e6d174a15949250704012ca7 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 7 Nov 2021 10:48:00 +0000 Subject: [PATCH] Tidying --- webapp_post.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/webapp_post.py b/webapp_post.py index 2a9323b96..e5b14f35d 100644 --- a/webapp_post.py +++ b/webapp_post.py @@ -123,6 +123,10 @@ def _htmlPostMetadataOpenGraph(domain: str, postJsonObject: {}) -> str: continue if not attachJson.get('mediaType'): continue + if not attachJson.get('url'): + continue + if not attachJson.get('name'): + continue description = None if attachJson['mediaType'].startswith('image/'): description = 'Attached: 1 image' @@ -130,9 +134,7 @@ def _htmlPostMetadataOpenGraph(domain: str, postJsonObject: {}) -> str: description = 'Attached: 1 video' elif attachJson['mediaType'].startswith('audio/'): description = 'Attached: 1 audio' - if description and \ - attachJson.get('name') and \ - attachJson.get('url'): + if description: if objJson.get('content'): description += '\n\n' + removeHtml(objJson['content']) metadata += \