From 603532188832edc1ddf8eedac4234843f8bfc36d Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 30 Aug 2019 12:47:30 +0100 Subject: [PATCH] Tidying --- webinterface.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/webinterface.py b/webinterface.py index 8611450c3..20249849b 100644 --- a/webinterface.py +++ b/webinterface.py @@ -1281,6 +1281,13 @@ def addEmbeddedVideoFromSites(content: str,width=400,height=300) -> str: return content return content +def addEmbeddedElements(content: str) -> str: + """Adds embedded elements for various media types + """ + content=addEmbeddedVideoFromSites(content) + content=addEmbeddedAudio(content) + return addEmbeddedVideo(content) + def individualPostAsHtml(baseDir: str, \ session,wfRequest: {},personCache: {}, \ nickname: str,domain: str,port: int, \ @@ -1545,9 +1552,7 @@ def individualPostAsHtml(baseDir: str, \ if not postJsonObject['object']['sensitive']: contentStr=postJsonObject['object']['content']+attachmentStr - contentStr=addEmbeddedVideoFromSites(contentStr) - contentStr=addEmbeddedAudio(contentStr) - contentStr=addEmbeddedVideo(contentStr) + contentStr=addEmbeddedElements(contentStr) else: postID='post'+str(createPassword(8)) contentStr='' @@ -1560,9 +1565,7 @@ def individualPostAsHtml(baseDir: str, \ contentStr+='' contentStr+='
' contentStr+=postJsonObject['object']['content']+attachmentStr - contentStr=addEmbeddedVideoFromSites(contentStr) - contentStr=addEmbeddedAudio(contentStr) - contentStr=addEmbeddedVideo(contentStr) + contentStr=addEmbeddedElements(contentStr) contentStr+='
' if postJsonObject['object'].get('tag'):