public TVDoc(FileInfo settingsFile, TheTVDB tvdb, CommandLineArgs args) { this.mTVDB = tvdb; this.Args = args; this.Ignore = new List<IgnoreItem>(); this.Workers = null; this.WorkerSemaphore = null; this.mStats = new TVRenameStats(); this.mDirty = false; this.TheActionList = new ItemList(); this.Settings = new TVSettings(); this.MonitorFolders = new List<String>(); this.IgnoreFolders = new List<String>(); this.SearchFolders = new List<String>(); ShowItems = new List<ShowItem>(); this.AddItems = new FolderMonitorEntryList(); this.DownloadDone = true; this.DownloadOK = true; this.ActionCancel = false; this.ScanProgDlg = null; this.LoadOK = ((settingsFile == null) || this.LoadXMLSettings(settingsFile)) && this.mTVDB.LoadOK; UpdateTVDBLanguage(); // StartServer(); }
public TVDoc([CanBeNull] FileInfo settingsFile, CommandLineArgs args) { Args = args; Library = new ShowLibrary(); CurrentStats = new TVRenameStats(); actionManager = new ActionEngine(CurrentStats); cacheManager = new CacheUpdater(); localFinders = new FindMissingEpisodesLocally(this); downloadFinders = new FindMissingEpisodesDownloading(this); searchFinders = new FindMissingEpisodesSearch(this); mDirty = false; TheActionList = new ItemList(); scanProgDlg = null; downloadIdentifiers = new DownloadIdentifiersController(); LoadOk = (settingsFile is null || LoadXMLSettings(settingsFile)) && TheTVDB.Instance.LoadOk; }
private void SetupScanUi(bool hidden) { if (!Args.Hide && Environment.UserInteractive) { scanProgDlg = new ScanProgress( TVSettings.Instance.DoBulkAddInScan, TVSettings.Instance.RenameCheck || TVSettings.Instance.MissingCheck, TVSettings.Instance.RemoveDownloadDirectoriesFiles || TVSettings.Instance.ReplaceWithBetterQuality, localFinders.Active(), downloadFinders.Active(), searchFinders.Active() ); if (hidden) { scanProgDlg.WindowState = FormWindowState.Minimized; } } else { scanProgDlg = null; } }
public void ActionGo(List<ShowItem> shows) { if (this.Settings.MissingCheck && !this.CheckAllFoldersExist(shows)) // only check for folders existing for missing check return; if (!this.DoDownloadsFG()) return; Thread ActionWork = new Thread(this.ScanWorker); ActionWork.Name = "ActionWork"; this.ActionCancel = false; if (!this.Args.Hide) { this.ScanProgDlg = new ScanProgress(this.Settings.RenameCheck || this.Settings.MissingCheck, this.Settings.MissingCheck && this.Settings.SearchLocally, this.Settings.MissingCheck && (this.Settings.CheckuTorrent || this.Settings.CheckSABnzbd), this.Settings.MissingCheck && this.Settings.SearchRSS); } else this.ScanProgDlg = null; ActionWork.Start(shows); if ((this.ScanProgDlg != null) && (this.ScanProgDlg.ShowDialog() == DialogResult.Cancel)) { this.ActionCancel = true; ActionWork.Interrupt(); } else ActionWork.Join(); this.ScanProgDlg = null; }
}; // TODO: move into settings, and allow user to edit these public TVDoc(FileInfo settingsFile, CommandLineArgs args) { this.Args = args; this.Ignore = new List<IgnoreItem>(); this.Workers = null; this.WorkerSemaphore = null; this.mStats = new TVRenameStats(); this.mDirty = false; this.TheActionList = new ItemList(); this.MonitorFolders = new List<String>(); this.IgnoreFolders = new List<String>(); this.SearchFolders = new List<String>(); ShowItems = new List<ShowItem>(); this.AddItems = new FolderMonitorEntryList(); this.DownloadDone = true; this.DownloadOK = true; this.ActionCancel = false; this.ScanProgDlg = null; this.Finders = new List<Finder> (); this.Finders.Add(new FileFinder(this)); this.Finders.Add(new RSSFinder(this)); this.Finders.Add(new uTorrentFinder(this)); this.Finders.Add(new SABnzbdFinder(this)); this.LoadOK = ((settingsFile == null) || this.LoadXMLSettings(settingsFile)) && TheTVDB.Instance.LoadOK; this.DownloadIdentifiers = new DownloadIdentifiersController(); UpdateTVDBLanguage(); // StartServer(); }
public void ActionGo(List<ShowItem> shows) { this.CurrentlyBusy = true; if (TVSettings.Instance.MissingCheck && !this.CheckAllFoldersExist(shows)) // only check for folders existing for missing check return; if (!this.DoDownloadsFG()) return; Thread ActionWork = new Thread(this.ScanWorker); ActionWork.Name = "ActionWork"; this.ActionCancel = false; foreach (Finder f in Finders) { f.reset(); } if (!this.Args.Hide) { this.ScanProgDlg = new ScanProgress(TVSettings.Instance.RenameCheck || TVSettings.Instance.MissingCheck, TVSettings.Instance.MissingCheck && TVSettings.Instance.SearchLocally, TVSettings.Instance.MissingCheck && (TVSettings.Instance.CheckuTorrent || TVSettings.Instance.CheckSABnzbd), TVSettings.Instance.MissingCheck && TVSettings.Instance.SearchRSS); } else this.ScanProgDlg = null; ActionWork.Start(shows); if ((this.ScanProgDlg != null) && (this.ScanProgDlg.ShowDialog() == DialogResult.Cancel)) { this.ActionCancel = true; ActionWork.Interrupt(); foreach (Finder f in Finders) { f.interrupt(); } } else ActionWork.Join(); this.ScanProgDlg = null; DownloadIdentifiers.reset(); this.CurrentlyBusy = false; }