feat: enhance YouTube API integration by adding support for topic channel ID and improving release sync functionality with localization updates

This commit is contained in:
Ümit Tunç
2026-05-20 22:45:01 +03:00
parent e9f737ab1d
commit ae3a697170
6 changed files with 167 additions and 18 deletions
+7 -2
View File
@@ -12,7 +12,8 @@ use Illuminate\Support\Str;
class SyncYoutubeReleases extends Command
{
protected $signature = 'youtube:sync-releases
{--channel= : Override YouTube channel ID}
{--channel= : Override YouTube main channel ID}
{--topic= : Override YouTube Topic channel ID (Yayınlananlar / art track)}
{--playlist= : Override Releases playlist ID}
{--dry-run : Show changes without writing to database}';
@@ -20,9 +21,10 @@ class SyncYoutubeReleases extends Command
public function handle(YouTubeService $youTubeService): int
{
if ($this->option('channel') || $this->option('playlist')) {
if ($this->option('channel') || $this->option('topic') || $this->option('playlist')) {
$youTubeService = new YouTubeService(
channelId: $this->option('channel') ?? config('services.youtube.channel_id'),
topicChannelId: $this->option('topic') ?? config('services.youtube.topic_channel_id'),
playlistId: $this->option('playlist') ?? config('services.youtube.playlist_id'),
);
}
@@ -34,6 +36,9 @@ class SyncYoutubeReleases extends Command
}
$this->info(__('music_productions.youtube_sync_started'));
$this->line(__('music_productions.youtube_sync_source', [
'source' => $youTubeService->getReleasesSourceLabel(),
]));
$this->line('Playlist ID: ' . $youTubeService->resolveReleasesPlaylistId());
try {