Add: remove tmp video thumb file after import & update tmp work path
This commit is contained in:
parent
a404dcf09b
commit
61780cb8ba
1 changed files with 3 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Reference in a new issue