private void bnFullAuto_Click(object sender, System.EventArgs e) { if (this.engine.AddItems.Count == 0) { return; } this.FMPStopNow = false; this.FMPUpto = "Identifying shows"; this.FMPPercent = 0; Thread fmpshower = new Thread(this.FMPShower) { Name = "Bulk Add Shows Progress (Full Auto)" }; fmpshower.Start(); while ((this.FMP == null) || (!this.FMP.Ready)) { Thread.Sleep(10); } int n = 0; int n2 = this.engine.AddItems.Count; foreach (FolderMonitorEntry ai in this.engine.AddItems) { this.FMPPercent = 100 * n++ / n2; if (this.FMPStopNow) { break; } if (ai.CodeKnown) { continue; } int p = ai.Folder.LastIndexOf(System.IO.Path.DirectorySeparatorChar); this.FMPUpto = ai.Folder.Substring(p + 1); // +1 makes -1 "not found" result ok BulkAddManager.GuessShowItem(ai, this.mDoc.Library); // update our display this.UpdateFMListItem(ai, true); this.lvFMNewShows.Update(); this.Update(); } this.FMPStopNow = true; }
private void bnFullAuto_Click(object _, System.EventArgs e) { if (engine.AddItems.Count == 0) { return; } CancellationTokenSource cts = new CancellationTokenSource(); TokenSource = cts; FmpUpto = "Identifying shows"; FmpPercent = 0; Thread fmpshower = new Thread(FmpShower) { Name = "Bulk Add Shows Progress (Full Auto)" }; fmpshower.Start(); while (progressDialog is null || !progressDialog.Ready) { Thread.Sleep(10); } int n = 0; int n2 = engine.AddItems.Count; foreach (FoundFolder ai in engine.AddItems) { FmpPercent = 100 * n++ / n2; if (cts.IsCancellationRequested) { break; } if (ai.CodeKnown) { continue; } BulkAddManager.GuessShowItem(ai, mDoc.Library, true); // update our display UpdateListItem(ai, true); lvFMNewShows.Update(); Update(); } cts.Cancel(); }
private void bnFullAuto_Click(object _, System.EventArgs e) { if (engine.AddItems.Count == 0) { return; } FmpStopNow = false; FmpUpto = "Identifying shows"; FmpPercent = 0; Thread fmpshower = new Thread(FmpShower) { Name = "Bulk Add Shows Progress (Full Auto)" }; fmpshower.Start(); while ((progressDialog == null) || (!progressDialog.Ready)) { Thread.Sleep(10); } int n = 0; int n2 = engine.AddItems.Count; foreach (FoundFolder ai in engine.AddItems) { FmpPercent = 100 * n++ / n2; if (FmpStopNow) { break; } if (ai.CodeKnown) { continue; } BulkAddManager.GuessShowItem(ai, mDoc.Library); // update our display UpdateListItem(ai, true); lvFMNewShows.Update(); Update(); } FmpStopNow = true; }
private void AskUserAboutShow([NotNull] FoundFolder folder) { if (folder.CodeKnown) { return; } BulkAddManager.GuessShowItem(folder, MDoc.Library, true); if (folder.CodeKnown) { return; } //FolderMonitorEdit ed = new FolderMonitorEdit(folder); //if ((ed.ShowDialog() != DialogResult.OK) || (ed.Code == -1)) //{ return; //} //folder.TVDBCode = ed.Code; }