From 61780cb8ba63fec383995a4d3c83fcf4f19d52ce Mon Sep 17 00:00:00 2001 From: Aroy-Art Date: Tue, 11 Mar 2025 21:00:40 +0100 Subject: [PATCH] Add: remove tmp video thumb file after import & update tmp work path --- backend/apps/files/tasks.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/apps/files/tasks.py b/backend/apps/files/tasks.py index a3faa28..5ed8434 100644 --- a/backend/apps/files/tasks.py +++ b/backend/apps/files/tasks.py @@ -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: