From df99b827dd0cc1e2fe440dd6a1bd3b76c133e842 Mon Sep 17 00:00:00 2001 From: Pablo Ogando Ferreira Date: Tue, 20 Aug 2024 13:11:34 +0200 Subject: [PATCH] fix(27178): fix remove captions if we are trying to upload new one with same name and language --- Services/CaptionsInsertService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Services/CaptionsInsertService.php b/Services/CaptionsInsertService.php index f6e7185..d5c1d24 100644 --- a/Services/CaptionsInsertService.php +++ b/Services/CaptionsInsertService.php @@ -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()]);