Use image attachments as preview images for partkeepr imports

Fixes issue #1115
This commit is contained in:
Jan Böhmer 2025-12-07 20:25:39 +01:00
parent c60b406157
commit 39ff4f81c0

View file

@ -150,6 +150,11 @@ trait PKImportHelperTrait
$target->addAttachment($attachment); $target->addAttachment($attachment);
$this->em->persist($attachment); $this->em->persist($attachment);
//If the attachment is an image, and the target has no master picture yet, set it
if ($attachment->isPicture() && $target->getMasterPictureAttachment() === null) {
$target->setMasterPictureAttachment($attachment);
}
} }
$this->em->flush(); $this->em->flush();