Fix that you couldn't save thumbnail and create html when custom upload folder

This commit is contained in:
2021-12-04 21:59:22 +01:00
parent 90f2b3c8de
commit ccb23d59e1

View File

@ -179,7 +179,7 @@ def generate_html(
html_url = f"{domain}{filename}"
filename += ".html"
with open(f"Uploads/{filename}", "w", encoding="utf-8") as file:
with open(f"{upload_folder}/{filename}", "w", encoding="utf-8") as file:
file.write(video_html)
return html_url
@ -220,6 +220,6 @@ def make_thumbnail(path_video: str, file_filename: str) -> str:
str: Returns thumbnail filename.
"""
out_filename = f"{domain}{file_filename}.jpg"
ffmpeg.input(path_video, ss="1").output(f"Uploads/{file_filename}.jpg", vframes=1).run()
ffmpeg.input(path_video, ss="1").output(f"{upload_folder}/{file_filename}.jpg", vframes=1).run()
return out_filename