protected override void DoCheck(SetProgressDelegate prog, TVDoc.ScanSettings settings) { BulkAddSeriesManager bam = new BulkAddSeriesManager(MDoc); bam.CheckFolders(settings.Token, prog, false, !settings.Unattended); AskUserAboutShows(settings, bam); if (!bam.AddItems.Any(s => s.CodeKnown)) { return; } var idsToAdd = bam.AddItems.Where(s => s.CodeKnown).Select(folder => new { Code = folder.ProviderCode, folder.Provider }).ToList(); bam.AddAllToMyShows(); List <ShowConfiguration> addedShows = idsToAdd.Select(s => MDoc.TvLibrary.GetShowItem(s.Code, s.Provider)).ToList(); //add each new show into the shows being scanned foreach (ShowConfiguration si in addedShows) { settings.Shows.Add(si); } LOGGER.Info("Added new shows called: {0}", addedShows.Select(si => si.ShowName).ToCsv()); MDoc.TvAddedOrEdited(true, settings.Unattended, settings.Hidden, settings.Owner, addedShows); }
protected override void DoCheck(SetProgressDelegate prog, TVDoc.ScanSettings settings) { BulkAddSeriesManager bam = new BulkAddSeriesManager(MDoc); bam.CheckFolders(settings.Token, prog, false, !settings.Unattended); AskUserAboutShows(settings, bam); if (!bam.AddItems.Any(s => s.CodeKnown)) { return; } List <int> idsToAdd = bam.AddItems.Where(s => s.CodeKnown).Select(folder => folder.TVDBCode).ToList(); bam.AddAllToMyShows(); MDoc.SetDirty(); MDoc.DoDownloadsFG(settings.Unattended, settings.Hidden, settings.Owner); List <ShowConfiguration> addedShows = idsToAdd.Select(s => MDoc.TvLibrary.GetShowItem(s)).ToList(); //add each new show into the shows being scanned foreach (ShowConfiguration si in addedShows) { settings.Shows.Add(si); } LOGGER.Info("Added new shows called: {0}", addedShows.Select(si => si.ShowName).ToCsv()); MDoc.DoWhenToWatch(true, settings.Unattended, settings.Hidden, settings.Owner); MDoc.WriteUpcoming(); MDoc.WriteRecent(); }
private void bnFolderMonitorDone_Click(object sender, System.EventArgs e) { if (engine.AddItems.Count > 0) { DialogResult res = MessageBox.Show("Add identified shows to \"My Shows\"?", "Bulk Add Shows", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (res != DialogResult.Yes) { return; } engine.AddAllToMyShows(); } Close(); }