fix video and audio links

master
Aevann 2023-03-15 08:00:02 +02:00
parent 2cf6b8d249
commit f5682dd483
2 changed files with 4 additions and 4 deletions

View File

@ -59,9 +59,9 @@ def process_files(files, v, body):
url = process_image(name, v) 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/'): elif file.content_type.startswith('video/'):
body = body.replace(f'[{file.filename}]', process_video(file, v), 1) body = body.replace(f'[{file.filename}]', f'{process_video(file, v)} ', 1)
elif file.content_type.startswith('audio/'): 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: else:
abort(415) abort(415)

View File

@ -213,9 +213,9 @@ def comment(v:User):
abort(400, str(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/'): elif file.content_type.startswith('video/'):
body = body.replace(f'[{file.filename}]', process_video(file, v), 1) body = body.replace(f'[{file.filename}]', f'{process_video(file, v)} ', 1)
elif file.content_type.startswith('audio/'): 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: else:
abort(415) abort(415)