From a1dba978651be2ea235372ada91ba7349f7e4e40 Mon Sep 17 00:00:00 2001 From: Alba Date: Mon, 9 Dec 2024 11:32:27 +0100 Subject: [PATCH] TTK-27357: Add condition to command --- Command/ImportYouTubeExternalPlayerCommand.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Command/ImportYouTubeExternalPlayerCommand.php b/Command/ImportYouTubeExternalPlayerCommand.php index 69a7384..9823615 100644 --- a/Command/ImportYouTubeExternalPlayerCommand.php +++ b/Command/ImportYouTubeExternalPlayerCommand.php @@ -60,6 +60,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int $progressBar->advance(); ++$count; + if (!empty($multimediaObject->external())) { + continue; + } + $this->updateMultimediaObject($multimediaObject); if (0 == $count % 50) { @@ -88,6 +92,7 @@ private function updateMultimediaObject(MultimediaObject $multimediaObject): voi $externalLink = 'https://www.youtube.com/embed/'.$multimediaObject->getProperty('youtube_import_id'); $externalMedia = $this->createExternalMedia($externalLink); $multimediaObject->addExternal($externalMedia); + $multimediaObject->setExternalType(); } private function createExternalMedia(string $externalLink): MediaInterface