/// <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); }
/// <summary> /// Refreshes the file counts of the episodes. /// </summary> public static void RefreshFileCounts() { var scanManager = new ScanManager(Factory.StorageProvider, Factory.DataProvider); scanManager.RefreshFileCounts(); }
/// <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); }
/// <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); } }