Exemplo n.º 1
0
 private void FillEpisodePossible(TvShowEpisode ep, bool reload)
 {
     try
     {
         IList<DestinationFolder> dest = new List<DestinationFolder>();
         foreach (DestinationFolder folder in ListDest.Items)
             dest.Add(folder);
         ep.FillPossibleFiles(dest);
         if (reload)
         {
             ClistAvailableFiles.Items.Clear();
             foreach (PossibleFile file in ep.PossibleFiles)
             {
                 file.ToCopy = true;
                 ClistAvailableFiles.Items.Add(file, true);
             }
         }
     }
     catch (Exception ex)
     {
         WriteLog(ex);
     }
 }
Exemplo n.º 2
0
        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);
            }
        }