dont include SITE_FULL in post urls

remotes/1693176582716663532/tmp_refs/heads/watchparty
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)
body += f"\n\n![]({url})"
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/'):
body += f"\n\n{process_audio(file)}"
body += f"\n\n{SITE_FULL}{process_audio(file)}"
else:
abort(415)
return body
@ -59,7 +59,7 @@ def process_audio(file):
)
g.db.add(media)
return f'{SITE_FULL}{name}'
return name
def webm_to_mp4(old, new, vid):
@ -117,7 +117,7 @@ def process_video(file):
)
g.db.add(media)
return f'{SITE_FULL}{new}'
return new

View File

@ -220,9 +220,9 @@ def comment(v):
abort(400, str(e))
body += f"\n\n![]({image})"
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/'):
body += f"\n\n{process_audio(file)}"
body += f"\n\n{SITE_FULL}{process_audio(file)}"
else:
abort(415)

View File

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