protected override void DoCheck([NotNull] SetProgressDelegate prog, ICollection <ShowItem> showList, TVDoc.ScanSettings settings) { BulkAddManager bam = new BulkAddManager(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); List <ShowItem> addedShows = idsToAdd.Select(s => MDoc.Library.ShowItem(s)).ToList(); //add each new show into the shows being scanned foreach (ShowItem si in addedShows) { showList.Add(si); } LOGGER.Info("Added new shows called: {0}", addedShows.Select(si => si?.ShowName).ToCsv()); MDoc.DoWhenToWatch(true, settings.Unattended, settings.Hidden); MDoc.WriteUpcoming(); MDoc.WriteRecent(); }
private void DoCheck() { tbResults.Parent = tabControl1; tabControl1.SelectedTab = tbResults; tabControl1.Update(); CancellationTokenSource cts = new CancellationTokenSource(); TokenSource = cts; FmpUpto = "Checking folders"; FmpPercent = 0; Thread fmpshower = new Thread(FmpShower) { Name = "'Bulk Add Shows' Progress (Folder Check)" }; fmpshower.Start(); while (progressDialog is null || !progressDialog.Ready) { Thread.Sleep(10); } engine.CheckFolders(cts.Token, UpdateProgress, true, true); cts.Cancel(); FillNewShowList(false); }
private void DoCheck() { tbResults.Parent = tabControl1; tabControl1.SelectedTab = tbResults; tabControl1.Update(); FmpStopNow = false; FmpUpto = "Checking folders"; FmpPercent = 0; Thread fmpshower = new Thread(FmpShower) { Name = "'Bulk Add Shows' Progress (Folder Check)" }; fmpshower.Start(); while (progressDialog == null || !progressDialog.Ready) { Thread.Sleep(10); } engine.CheckFolders(ref FmpStopNow, ref FmpPercent); FmpStopNow = true; FillNewShowList(false); }