Add: pdf thumb gen to import data commmand
This commit is contained in:
parent
53e3149719
commit
82f630789a
1 changed files with 5 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue