Skip to content

Commit

Permalink
fix(27178): fix remove captions if we are trying to upload new one wi…
Browse files Browse the repository at this point in the history
…th same name and language
  • Loading branch information
Yurujai committed Aug 20, 2024
1 parent 682327b commit df99b82
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Services/CaptionsInsertService.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function uploadCaption(Youtube $youtube, MultimediaObject $multimediaObje
]);

if (!empty($youtube->getCaptionUpdateError()) && 'captionExists' === $youtube->getCaptionUpdateError()->id()) {
$captionsUploaded = $this->captionsListService->findAll($account, $videoId);
$captionsUploaded = $this->captionsListService->findAll($account, $youtube->getYoutubeId());
foreach ($captionsUploaded->getItems() as $caption) {
if ($caption->getSnippet()->getName() === $material->getName() && $caption->getSnippet()->getLanguage() === $material->getLanguage()) {
$this->captionsDeleteService->deleteCaption($account, $youtube, [$caption->getId()]);
Expand Down

0 comments on commit df99b82

Please sign in to comment.