Add: pdf thumb gen to import data commmand

This commit is contained in:
Aroy-Art 2025-03-17 15:20:39 +01:00
parent 53e3149719
commit 82f630789a
Signed by: Aroy
GPG key ID: 583642324A1D2070

View file

@ -33,6 +33,7 @@ from apps.files.tasks import (
generate_blur_hash_PostFile,
generate_md5_hash_PostFile,
generate_video_thumbnail,
generate_pdf_thumbnail,
)
@ -149,6 +150,10 @@ class BaseImporter(ABC):
if not file_instance.thumbnail:
generate_video_thumbnail.delay(file_instance.id)
if file_instance.file_type in ["pdf"]:
if not file_instance.thumbnail:
generate_pdf_thumbnail.delay(file_instance.id)
# Generate MD5 hash if not exists
if not file_instance.hash_md5:
generate_md5_hash_PostFile.delay(file_instance.id)