diff --git a/files/helpers/media.py b/files/helpers/media.py index a9528d978..ee90a14f3 100644 --- a/files/helpers/media.py +++ b/files/helpers/media.py @@ -56,11 +56,11 @@ def process_files(files, v, body): name = f'/images/{time.time()}'.replace('.','') + '.webp' file.save(name) url = process_image(name, v) - body = body.replace(f'[{file.filename}]', f'{url} ', 1) + body = body.replace(f'[{file.filename}]', f' {url} ', 1) elif file.content_type.startswith('video/'): - body = body.replace(f'[{file.filename}]', f'{process_video(file, v)} ', 1) + body = body.replace(f'[{file.filename}]', f' {process_video(file, v)} ', 1) elif file.content_type.startswith('audio/'): - body = body.replace(f'[{file.filename}]', f"{SITE_FULL}{process_audio(file, v)} ", 1) + body = body.replace(f'[{file.filename}]', f' {SITE_FULL}{process_audio(file, v)} ', 1) else: abort(415) @@ -316,7 +316,7 @@ def process_dm_images(v, user, body): try: url = req['files'][0]['url'] except: abort(400, req['description']) - body = body.replace(f'[{file.filename}]', f'{url} ', 1) + body = body.replace(f'[{file.filename}]', f' {url} ', 1) with open(f"{LOG_DIRECTORY}/dm_images.log", "a+", encoding="utf-8") as f: if user: diff --git a/files/routes/comments.py b/files/routes/comments.py index 7383fc032..4f7cb3f88 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -211,11 +211,11 @@ def comment(v:User): purge_files_in_cache(f"https://{SITE}/assets/images/badges/{badge.id}.webp") except Exception as e: abort(400, str(e)) - body = body.replace(f'[{file.filename}]', f'{image} ', 1) + body = body.replace(f'[{file.filename}]', f' {image} ', 1) elif file.content_type.startswith('video/'): - body = body.replace(f'[{file.filename}]', f'{process_video(file, v)} ', 1) + body = body.replace(f'[{file.filename}]', f' {process_video(file, v)} ', 1) elif file.content_type.startswith('audio/'): - body = body.replace(f'[{file.filename}]', f"{SITE_FULL}{process_audio(file, v)} ", 1) + body = body.replace(f'[{file.filename}]', f' {SITE_FULL}{process_audio(file, v)} ', 1) else: abort(415)