/// <summary> /// Handles the DoWork event of the bgw control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.ComponentModel.DoWorkEventArgs"/> instance containing the event data.</param> private void bgw_DoWork(object sender, DoWorkEventArgs e) { this.bgw.ReportProgress(17, "Loading Media Path Database"); DatabaseIOFactory.Load(DatabaseIOFactory.OutputName.MediaPathDb); this.bgw.ReportProgress(34, "Loading Movie Database"); DatabaseIOFactory.Load(DatabaseIOFactory.OutputName.MovieDb); this.bgw.ReportProgress(51, "Loading Media Sets Database"); DatabaseIOFactory.Load(DatabaseIOFactory.OutputName.MovieSets); this.bgw.ReportProgress(68, "Loading Tv Database"); DatabaseIOFactory.Load(DatabaseIOFactory.OutputName.TvDb); this.bgw.ReportProgress(80, "Loading Media Path Database"); DatabaseIOFactory.Load(DatabaseIOFactory.OutputName.ScanSeriesPick); this.bgw.ReportProgress(88, "Populating Movie Media Database"); MasterMediaDBFactory.PopulateMasterMovieMediaDatabase(); this.bgw.ReportProgress(96, "Populating TV Media Database"); MasterMediaDBFactory.PopulateMasterTvMediaDatabase(); this.bgw.ReportProgress(97, "Validating Sets"); MovieSetManager.ValidateSets(); this.bgw.ReportProgress(100, "Done."); }
/// <summary> /// Loads the specified output name. /// </summary> /// <param name="outputName"> /// Name of the output. /// </param> public static void Load(OutputName outputName) { switch (outputName) { case OutputName.MovieDb: LoadMovieDB(); break; case OutputName.MediaPathDb: LoadMediaPathDb(); break; case OutputName.MovieSets: LoadMovieSets(); break; case OutputName.TvDb: LoadTvDB(); break; case OutputName.ScanSeriesPick: LoadScanSeriesPick(); break; case OutputName.All: LoadMovieDB(); LoadMovieSets(); LoadMediaPathDb(); MasterMediaDBFactory.PopulateMasterMovieMediaDatabase(); LoadTvDB(); LoadScanSeriesPick(); MasterMediaDBFactory.PopulateMasterTvMediaDatabase(); break; } }
/// <summary> /// The do import scan. /// </summary> public static void DoImportScan() { SeriesNameList = new BindingList <SeriesListModel>(); Scan = new SortedDictionary <string, ScanSeries>(); // Get file list var filters = Get.InOutCollection.VideoExtentions; var paths = MediaPathDBFactory.GetMediaPathTvUnsorted(); var filteredFiles = (from file in paths let pathAndFileName = Path.GetExtension(file.PathAndFileName).ToLower() where filters.Any(filter => pathAndFileName.ToLower() == "." + filter.ToLower()) select file.PathAndFileName).ToList(); // Process each file and add to ScanDB); foreach (var f in filteredFiles) { var episodeDetails = GetEpisodeDetails(f); if (episodeDetails.TvMatchSuccess) { AddScanResult(episodeDetails); } else { NotCatagorized.Add(new ScanNotCatagorized { FilePath = f }); } } MasterMediaDBFactory.PopulateMasterTvMediaDatabase(); }