From 6f8a82fed114b25dd5e50d7b1d933ae3695b5b76 Mon Sep 17 00:00:00 2001 From: albacodina <48245111+albacodina@users.noreply.github.com> Date: Mon, 9 Dec 2024 11:42:24 +0100 Subject: [PATCH] TTK-27357: Add condition to command (#131) --- 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