Skip to content

Commit

Permalink
TTK-27357: Change track functions
Browse files Browse the repository at this point in the history
  • Loading branch information
albacodina committed Nov 28, 2024
1 parent 4e2b59c commit f3457ec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Services/VideoDataValidationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions Services/VideoInsertService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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',
]
Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit f3457ec

Please sign in to comment.