forked from rDrama/rDrama
put a space before file link too
parent
0b0ad438a8
commit
8d096e1123
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue