Handles the scanning of files.
Exemple #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FileManager"/> class. Initialises a new instance of the <see cref="FileManager"/> class.
 /// </summary>
 /// <param name="storageProvider">
 /// The storage provider.
 /// </param>
 /// <param name="dataProvider">
 /// The data provider.
 /// </param>
 internal FileManager(IStorageProvider storageProvider, IDataProvider dataProvider)
 {
     this.storageProvider = storageProvider;
     this.settings = Settings.LoadSettings(storageProvider);
     this.scanManager = new ScanManager(this.storageProvider, dataProvider);
 }
        public override void Setup()
        {
            base.Setup();

            this.dataProvider = Substitute.For<IDataProvider>();
            this.scanManager = new ScanManager(this.StorageProvider, this.dataProvider);
        }
Exemple #3
0
 /// <summary>
 /// Refreshes the file counts of the episodes.
 /// </summary>
 public static void RefreshFileCounts()
 {
     var scanManager = new ScanManager(Factory.StorageProvider, Factory.DataProvider);
     scanManager.RefreshFileCounts();
 }
Exemple #4
0
        /// <summary>
        /// Performs a search.
        /// </summary>
        /// <param name="subDirectory">
        /// The sub directory to search.
        /// </param>
        public void Search(string subDirectory)
        {
            if (subDirectory == null)
            {
                subDirectory = Path.DirectorySeparatorChar.ToString(CultureInfo.InvariantCulture);
            }

            var scanManager = new ScanManager(Factory.StorageProvider, Factory.DataProvider);
            this.Results = scanManager.Refresh(subDirectory);
            Logger.OnLogMessage(this, "Scan complete. Found {0} files.", LogType.Info, this.Results.Count);
        }
Exemple #5
0
 /// <summary>
 /// Sets the show of the checked results.
 /// </summary>
 /// <param name="show">
 /// The show to set them to.
 /// </param>
 public void SetShow(TvShow show)
 {
     var scanManager = new ScanManager(Factory.StorageProvider, Factory.DataProvider);
     foreach (FileResult result in this.Results.Where(x => x.Checked))
     {
         scanManager.ResetShow(result, show);
     }
 }