remove legacy code in video upload (thx @everyone)

remotes/1693045480750635534/spooky-22
Aevann1 2022-06-18 18:23:10 +02:00
parent 22557b62fb
commit b34dd88560
5 changed files with 5 additions and 15 deletions

View File

@ -20,9 +20,7 @@ def process_files():
url = process_image(v.patron, name)
body += f"\n\n![]({url})"
elif file.content_type.startswith('video/'):
value = process_video(file)
if type(value) is str: body += f"\n\n{value}"
else: return value
body += f"\n\n{process_video(file)}"
elif file.content_type.startswith('audio/'):
body += f"\n\n{process_audio(file)}"
else:

View File

@ -293,9 +293,7 @@ def api_comment(v):
return {"error": str(e)}, 400
body += f"\n\n![]({image})"
elif file.content_type.startswith('video/'):
value = process_video(file)
if type(value) is str: body += f"\n\n{value}"
else: return value
body += f"\n\n{process_video(file)}"
elif file.content_type.startswith('audio/'):
body += f"\n\n{process_audio(file)}"
else:

View File

@ -1060,9 +1060,7 @@ def submit_post(v, sub=None):
copyfile(name, name2)
post.thumburl = process_image(v.patron, name2, resize=100)
elif file.content_type.startswith('video/'):
value = process_video(file)
if type(value) is str: post.url = value
else: return error(value['error'])
post.url = process_video(file)
elif file.content_type.startswith('audio/'):
post.url = process_audio(file)
else:

View File

@ -207,9 +207,7 @@ def submit_contact(v):
url = process_image(v.patron, name)
body_html += f'<img data-bs-target="#expandImageModal" data-bs-toggle="modal" onclick="expandDesktopImage(this.src)" class="img" src="{url}" loading="lazy">'
elif file.content_type.startswith('video/'):
value = process_video(file)
if type(value) is str: body_html += f"<p>{value}</p>"
else: return value
body_html += f"<p>{process_video(file)}</p>"
elif file.content_type.startswith('audio/'):
body_html += f"<p>{process_audio(file)}</p>"
else:

View File

@ -734,9 +734,7 @@ def messagereply(v):
url = process_image(v.patron, name)
body_html += f'<img data-bs-target="#expandImageModal" data-bs-toggle="modal" onclick="expandDesktopImage(this.src)" class="img" src="{url}" loading="lazy">'
elif file.content_type.startswith('video/'):
value = process_video(file)
if type(value) is str: body_html += f"<p>{value}</p>"
else: return value
body_html += f"<p>{process_video(file)}</p>"
elif file.content_type.startswith('audio/'):
body_html += f"<p>{process_audio(file)}</p>"
else: