private static void DownloadProgramResponses(int start) { // reject 0 requests if (programQueue.Count - start < 1) { return; } // build the array of programs to request for var programs = new string[Math.Min(programQueue.Count - start, MaxQueries)]; for (var i = 0; i < programs.Length; ++i) { programs[i] = programQueue[start + i]; } // request programs from Schedules Direct var responses = SdApi.GetPrograms(programs); if (responses != null) { Parallel.ForEach(responses, (response) => { programResponses.Add(response); }); } }
private static bool GetExtendedSeriesDataForUiPlus(int start = 0) { // build the array of programs to request for var programs = new string[Math.Min(seriesDescriptionQueue.Count - start, MaxQueries)]; for (var i = 0; i < programs.Length; ++i) { programs[i] = seriesDescriptionQueue[start + i]; } // request programs from Schedules Direct var responses = SdApi.GetPrograms(programs); if (responses == null) { return(false); } // process request response var idx = 0; foreach (var response in responses) { if (response == null) { Logger.WriteInformation($"Did not receive data for program {programs[idx++]}."); continue; } ++idx; ++processedObjects; ReportProgress(); // add the series extended data to the file if not already present from program builds if (!ModernMediaUiPlus.Programs.ContainsKey(response.ProgramId)) { AddModernMediaUiPlusProgram(response); } // add the series start air date if available UpdateSeriesAirdate(response.ProgramId, response.OriginalAirDate); } return(true); }