Exemplo n.º 1
0
        public void CheckFolders(CancellationToken token, [NotNull] SetProgressDelegate prog, bool detailedLogging, bool showErrorMsgBox)
        {
            // Check the  folder list, and build up a new "AddItems" list.
            // guessing what the shows actually are isn't done here.  That is done by
            // calls to "GuessShowItem"
            Logger.Info("*********************************************************************");
            Logger.Info("*Starting to find folders that contain files, but are not in library*");

            AddItems = new FolderMonitorEntryList();

            int c = TVSettings.Instance.LibraryFolders.Count;

            int c2 = 0;

            foreach (string folder in TVSettings.Instance.LibraryFolders)
            {
                prog.Invoke(100 * c2++ / c, folder);
                DirectoryInfo di = new DirectoryInfo(folder);

                CheckFolderForShows(di, token, detailedLogging, showErrorMsgBox);

                if (token.IsCancellationRequested)
                {
                    break;
                }
            }
            prog.Invoke(100, string.Empty);
        }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
0
                                       }; // 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();
        }
Exemplo n.º 4
0
        public void MonitorCheckFolders(ref bool stop, ref int percentDone)
        {
            // Check the monitored folder list, and build up a new "AddItems" list.
            // guessing what the shows actually are isn't done here.  That is done by
            // calls to "MonitorGuessShowItem"

            this.AddItems = new FolderMonitorEntryList();

            int c = this.MonitorFolders.Count;

            this.LockShowItems();
            int c2 = 0;
            foreach (string folder in this.MonitorFolders)
            {
                percentDone = 100 * c2++ / c;
                DirectoryInfo di = new DirectoryInfo(folder);
                if (!di.Exists)
                    continue;

                this.MonitorCheckFolderRecursive(di, ref stop);

                if (stop)
                    break;
            }

            this.UnlockShowItems();
        }
Exemplo n.º 5
0
 public BulkAddManager(TVDoc doc)
 {
     AddItems = new FolderMonitorEntryList();
     mDoc     = doc;
 }