Skip to content

Commit

Permalink
fix(27168): set locale using configuration locale for YouTube
Browse files Browse the repository at this point in the history
  • Loading branch information
Yurujai committed Aug 8, 2024
1 parent 029bdc4 commit bf6fa3b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Services/PlaylistInsertService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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);
}
}
Expand Down

0 comments on commit bf6fa3b

Please sign in to comment.