Skip to content

Commit

Permalink
TTK-27357: Add condition to command (#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
albacodina authored Dec 9, 2024
1 parent da7719d commit 6f8a82f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Command/ImportYouTubeExternalPlayerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6f8a82f

Please sign in to comment.