public void AddAllToEnrichedPrograms(GuideEnricherProgram program) { SuccessfulPrograms.Add(program); PendingPrograms.Remove(program); // only if SubTitle is NOT empty var similarPrograms = this.FindSimilarPrograms(this.PendingPrograms.FindAll(x => !string.IsNullOrEmpty(x.SubTitle) && x.SubTitle == program.OriginalSubTitle), program); if (similarPrograms.Count > 0) { PendingPrograms = new List <GuideEnricherProgram>(PendingPrograms.Except(similarPrograms)); foreach (GuideEnricherProgram similarProgram in similarPrograms) { similarProgram.SeriesNumber = program.SeriesNumber; similarProgram.EpisodeNumber = program.EpisodeNumber; similarProgram.EpisodeNumberDisplay = program.EpisodeNumberDisplay; if (this.updateSubtitles) { similarProgram.SubTitle = program.SubTitle; } if (this.updateDescription) { similarProgram.Description = program.Description; } } SuccessfulPrograms.AddRange(similarPrograms); } }
public void AddAllToFailedPrograms(GuideEnricherProgram program) { FailedPrograms.Add(program); PendingPrograms.Remove(program); List <GuideEnricherProgram> similarPrograms = PendingPrograms.FindAll(x => x.SubTitle == program.OriginalSubTitle && !(string.IsNullOrEmpty(program.OriginalSubTitle))); if (similarPrograms.Count > 0) { PendingPrograms = new List <GuideEnricherProgram>(PendingPrograms.Except(similarPrograms)); FailedPrograms.AddRange(similarPrograms); } }