feat: import actor awards during film batch import
This commit is contained in:
@@ -10,6 +10,7 @@ use App\Gateway\LtbxdGateway;
|
||||
use App\Message\ImportFilmsBatchMessage;
|
||||
use App\Repository\ImportRepository;
|
||||
use App\Service\ActorSyncer;
|
||||
use App\Service\AwardImporter;
|
||||
use App\Service\FilmImporter;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use League\Flysystem\FilesystemOperator;
|
||||
@@ -25,6 +26,7 @@ readonly class ImportFilmsBatchMessageHandler
|
||||
private LtbxdGateway $ltbxdGateway,
|
||||
private FilmImporter $filmImporter,
|
||||
private ActorSyncer $actorSyncer,
|
||||
private AwardImporter $awardImporter,
|
||||
private ImportRepository $importRepository,
|
||||
private LoggerInterface $logger,
|
||||
) {}
|
||||
@@ -62,6 +64,11 @@ readonly class ImportFilmsBatchMessageHandler
|
||||
|
||||
$this->actorSyncer->syncActorsForMovie($movie);
|
||||
|
||||
// Import awards for actors of this movie
|
||||
foreach ($movie->getActors() as $role) {
|
||||
$this->awardImporter->importForActor($role->getActor());
|
||||
}
|
||||
|
||||
$user = $this->em->getReference(\App\Entity\User::class, $userId);
|
||||
$existingLink = $this->em->getRepository(UserMovie::class)->findOneBy([
|
||||
'user' => $user,
|
||||
|
||||
Reference in New Issue
Block a user