diff --git a/Services/VideoDataValidationService.php b/Services/VideoDataValidationService.php index 8be381d..be18dcd 100644 --- a/Services/VideoDataValidationService.php +++ b/Services/VideoDataValidationService.php @@ -14,7 +14,7 @@ use Pumukit\SchemaBundle\Document\MultimediaObject; use Pumukit\SchemaBundle\Document\Person; use Pumukit\SchemaBundle\Document\Tag; -use Pumukit\SchemaBundle\Document\Track; +use Pumukit\SchemaBundle\Document\MediaType\Track; use Pumukit\SchemaBundle\Document\ValueObject\Path; use Pumukit\SchemaBundle\Services\TagService; use Pumukit\YoutubeBundle\PumukitYoutubeBundle; @@ -75,7 +75,7 @@ public function validateMultimediaObjectTrack(MultimediaObject $multimediaObject return null; } - $trackPath = $track->getPath(); + $trackPath = $track->storage()->path()->path(); if (!file_exists($trackPath)) { $errorLog = self::class.' ['.__FUNCTION__.'] Error, there is no file '.$trackPath; $this->logger->error($errorLog); @@ -229,7 +229,7 @@ protected function generateSbsTrack(MultimediaObject $multimediaObject) return 0; } $track = $tracks[0]; - $path = $track->getPath(); + $path = $track->storage()->path()->path(); $language = $track->getLanguage() ?: \Locale::getDefault(); $jobOptions = new JobOptions($this->youtubeConfigurationService->sbsProfileName(), 2, $language, [], [], $track->getDuration()); $path = Path::create($path); @@ -281,11 +281,11 @@ private function getTrack(MultimediaObject $multimediaObject) } else { $track = $multimediaObject->getTrackWithTag($this->youtubeConfigurationService->defaultTrackUpload()); } - if (!$track || $track->isOnlyAudio()) { + if (!$track || $track->metadata()->isOnlyAudio()) { $track = $multimediaObject->getTrackWithTag('master'); } - if ($track && !$track->isOnlyAudio()) { + if ($track && !$track->metadata()->isOnlyAudio()) { return $track; } diff --git a/Services/VideoInsertService.php b/Services/VideoInsertService.php index 59a24e4..f55854f 100644 --- a/Services/VideoInsertService.php +++ b/Services/VideoInsertService.php @@ -95,7 +95,7 @@ private function insert( \Google_Service_YouTube_Video $video, Track $track ): ?Video { - $infoLog = sprintf('[YouTube] Video insert ( %s ) with track %s', $video->getSnippet()->getTitle(), $track->getId()); + $infoLog = sprintf('[YouTube] Video insert ( %s ) with track %s', $video->getSnippet()->getTitle(), $track->id()); $this->logger->info($infoLog); $service = $this->googleAccountService->googleServiceFromAccount($youtubeAccount); @@ -104,7 +104,7 @@ private function insert( 'snippet,status', $video, [ - 'data' => file_get_contents($track->getPath()), + 'data' => file_get_contents($track->storage()->path()->path()), 'mimeType' => 'application/octet-stream', 'uploadType' => 'multipart', ] @@ -156,7 +156,7 @@ private function updateVideoAndYoutubeDocumentByResult( $youtube->removeError(); $youtube->setYoutubeId($video->getId()); $youtube->setLink('https://www.youtube.com/watch?v='.$video->getId()); - $youtube->setFileUploaded(basename($track->getPath())); + $youtube->setFileUploaded(basename($track->storage()->path()->path())); $multimediaObject->setProperty('youtubeurl', $youtube->getLink()); $code = $this->getEmbed($video->getId());