diff --git a/YTManager/Tasks/FetchVideos.cs b/YTManager/Tasks/FetchVideos.cs index 5d4af8f..10679f1 100644 --- a/YTManager/Tasks/FetchVideos.cs +++ b/YTManager/Tasks/FetchVideos.cs @@ -37,6 +37,7 @@ namespace YTManager.Tasks { }).ToList(); } + // Gets some info about a youtube channel. public static async Task Get_YTChannel(string channelID) { // YT API access key var youtubeService = new YouTubeService(new Google.Apis.Services.BaseClientService.Initializer() @@ -68,10 +69,13 @@ namespace YTManager.Tasks { ops.UseNpgsql(dbstr); // Get all the channels from the db. - var channels = await (new MediaDB(ops.Options)).Channels.ToListAsync(); + var channel_ids = await + (new MediaDB(ops.Options)) + .Channels.Select(ch => ch.YoutubeID) + .ToListAsync(); // For each channel, do an update. - channels.ForEach(async ch => await ChannelUpdate(dbstr, ch.YoutubeID)); + channel_ids.ForEach(async id => await ChannelUpdate(dbstr, id)); } // Update videos for just one channel.