Add: remove tmp video thumb file after import & update tmp work path

This commit is contained in:
Aroy-Art 2025-03-11 21:00:40 +01:00
parent a404dcf09b
commit 61780cb8ba
Signed by: Aroy
GPG key ID: 583642324A1D2070

View file

@ -85,7 +85,7 @@ def generate_video_thumbnail(
video_path = pstfile.file.path
# Create output directory if it doesn't exist
output_dir = os.path.join("/tmp/thumbgen/", str(file_id))
output_dir = "/tmp/thumbgen/"
os.makedirs(output_dir, exist_ok=True)
thumbnail_filename = f"thumbnail_{pstfile.hash_blake3}.png"
@ -127,6 +127,8 @@ def generate_video_thumbnail(
pstfile.save()
os.remove(thumbnail_file_path)
return f"Thumbnail generated and saved to {thumbnail_file_path}"
except subprocess.CalledProcessError as e: