dont include SITE_FULL in post urls

master
Aevann1 2022-10-18 13:09:53 +02:00
parent 5d550d4c7a
commit 465160dbe6
3 changed files with 9 additions and 6 deletions

View File

@ -25,9 +25,9 @@ def process_files():
url = process_image(name, patron=g.v.patron) url = process_image(name, patron=g.v.patron)
body += f"\n\n![]({url})" body += f"\n\n![]({url})"
elif file.content_type.startswith('video/'): elif file.content_type.startswith('video/'):
body += f"\n\n{process_video(file)}" body += f"\n\n{SITE_FULL}{process_video(file)}"
elif file.content_type.startswith('audio/'): elif file.content_type.startswith('audio/'):
body += f"\n\n{process_audio(file)}" body += f"\n\n{SITE_FULL}{process_audio(file)}"
else: else:
abort(415) abort(415)
return body return body
@ -59,7 +59,7 @@ def process_audio(file):
) )
g.db.add(media) g.db.add(media)
return f'{SITE_FULL}{name}' return name
def webm_to_mp4(old, new, vid): def webm_to_mp4(old, new, vid):
@ -117,7 +117,7 @@ def process_video(file):
) )
g.db.add(media) g.db.add(media)
return f'{SITE_FULL}{new}' return new

View File

@ -220,9 +220,9 @@ def comment(v):
abort(400, str(e)) abort(400, str(e))
body += f"\n\n![]({image})" body += f"\n\n![]({image})"
elif file.content_type.startswith('video/'): elif file.content_type.startswith('video/'):
body += f"\n\n{process_video(file)}" body += f"\n\n{SITE_FULL}{process_video(file)}"
elif file.content_type.startswith('audio/'): elif file.content_type.startswith('audio/'):
body += f"\n\n{process_audio(file)}" body += f"\n\n{SITE_FULL}{process_audio(file)}"
else: else:
abort(415) abort(415)

View File

@ -882,6 +882,9 @@ def submit_post(v, sub=None):
if embed: embed = embed.strip() if embed: embed = embed.strip()
if url and url.startswith(SITE_FULL):
url = url.split(SITE_FULL)[1]
post = Submission( post = Submission(
private=bool(request.values.get("private","")), private=bool(request.values.get("private","")),
notify=bool(request.values.get("notify","")), notify=bool(request.values.get("notify","")),