From bf6fa3bf90ad099df9fb42f6e46b8488971e5769 Mon Sep 17 00:00:00 2001 From: Pablo Ogando Ferreira Date: Thu, 8 Aug 2024 12:54:36 +0200 Subject: [PATCH] fix(27168): set locale using configuration locale for YouTube --- Services/PlaylistInsertService.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Services/PlaylistInsertService.php b/Services/PlaylistInsertService.php index ecae165..dca37fa 100644 --- a/Services/PlaylistInsertService.php +++ b/Services/PlaylistInsertService.php @@ -58,7 +58,7 @@ public function insertPlaylistsFromPuMuKIT(Tag $account): bool { foreach ($account->getChildren() as $child) { try { - if ($this->playlistDataValidationService->isValidTitle($child->getTitle())) { + if ($this->playlistDataValidationService->isValidTitle($child->getTitle($this->youtubeConfigurationService->locale()))) { $child->setProperty('youtube_error', 'Playlist title have more characters than allowed on YouTube'); continue; @@ -115,7 +115,7 @@ public function insertPlaylistsFromYouTube(Tag $account): void public function insertOnePlaylist(Tag $account, Tag $playlistTag): void { $playlist = $this->createGoogleServiceYoutubePlaylist(); - $playlistSnippet = $this->createPlaylistSnippet($playlistTag->getTitle(), ''); + $playlistSnippet = $this->createPlaylistSnippet($playlistTag->getTitle($this->youtubeConfigurationService->locale()), ''); $playlistStatus = $this->createPlaylistStatus($this->youtubeConfigurationService->playlistPrivateStatus()); $playlist->setSnippet($playlistSnippet); $playlist->setStatus($playlistStatus); @@ -127,7 +127,7 @@ public function insertOnePlaylist(Tag $account, Tag $playlistTag): void $playlistTag->removeProperty('youtube_error'); } catch (\Exception $exception) { $playlistTag->setProperty('youtube_error', $exception->getMessage()); - $errorLog = sprintf('[YouTube] Upload playlist %s failed. Error: %s', $playlistTag->getTitle(), $exception->getMessage()); + $errorLog = sprintf('[YouTube] Upload playlist %s failed. Error: %s', $playlistTag->getTitle($this->youtubeConfigurationService->locale()), $exception->getMessage()); $this->logger->error($errorLog); } }