forked from MarseyWorld/MarseyWorld
remove legacy code in video upload (thx @everyone)
parent
22557b62fb
commit
b34dd88560
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue