private void bgWorkerRename_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e) { DestinationFolder dest = new DestinationFolder(((SourceFolder)CboxRenameSource.SelectedItem).FolderPath); List<DestinationFolder> folder = new List<DestinationFolder>(); folder.Add(dest); List<string> fold = new List<string>(); fold.Add(dest.FolderPath); string[] files = new string[0]; //string[] errors = new string[0]; foreach (string ext in TvShowEpisode.AvailableExtensions) files = files.Concat(Directory.GetFiles(((SourceFolder)CboxRenameSource.SelectedItem).FolderPath, "*." + ext, SearchOption.AllDirectories)).ToArray(); foreach (string file in files) { TvShowEpisode ep = new TvShowEpisode(file); ep.FillTitle(0, folder); ep.FillFromFilter(TboxOldFilter.Text); ep.Filter = TboxSeriesFilter.Text; ep.FillPossibleFiles(folder); ep.Move(); //foreach (string error in ep.Rename()) // WriteLog(error); } files = new string[0]; foreach (string ext in Subtitle.AvailableExtensions) files = files.Concat(Directory.GetFiles(((SourceFolder)CboxRenameSource.SelectedItem).FolderPath, "*." + ext, SearchOption.AllDirectories)).ToArray(); foreach (string file in files) { Subtitle st = new Subtitle(file); st.FillFromFilter(TboxOldFilter.Text); st.FillSearchFilter(TboxSeriesFilter.Text); st.FindVideos(fold, true); st.Rename(true); } }
private void bgWorkerRenameLoad_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e) { TboxOldFilter.Enabled = CboxRenameSource.Enabled = false; string[] files = new string[0]; foreach (string ext in TvShowEpisode.AvailableExtensions) files = files.Concat(Directory.GetFiles(((SourceFolder)CboxRenameSource.SelectedItem).FolderPath, "*." + ext, SearchOption.AllDirectories)).ToArray(); if (files.Length > 0) { TvShowEpisode ep = new TvShowEpisode(files[0]); DestinationFolder dest = new DestinationFolder(((SourceFolder)CboxRenameSource.SelectedItem).FolderPath); List<DestinationFolder> folder = new List<DestinationFolder>(); folder.Add(dest); //ep.FillTitle(0, folder); try { ep.FillFromFilter(TboxOldFilter.Text); ep.Filter = TboxSeriesFilter.Text; TboxApercuRename.Text = ep.ApplyFilter(); } catch { TboxApercuRename.Text = ep.FileName; } } }