Example #1
0
 /// <summary>
 /// Détermine si le dossier est un dossier de destination pour l'épisode.
 /// </summary>
 /// <param name="dest">Dossier de destination</param>
 /// <returns>Retourne vrai si le dossier de destination est valable.</returns>
 protected virtual bool IsGoodDestination(DestinationFolder dest)
 {
     return dest.FolderType == DestinationFolder.Type.All || dest.FolderType == DestinationFolder.Type.Series || (IsHD && dest.FolderType == DestinationFolder.Type.Series_HD) || (!IsHD && dest.FolderType == DestinationFolder.Type.Series_LD);
 }
Example #2
0
 public static bool IsGoodDestination(DestinationFolder dest, bool IsHD)
 {
     return dest.FolderType == DestinationFolder.Type.All || dest.FolderType == DestinationFolder.Type.Series || (IsHD && dest.FolderType == DestinationFolder.Type.Series_HD) || (!IsHD && dest.FolderType == DestinationFolder.Type.Series_LD);
 }
Example #3
0
 /// <summary>
 /// Détermine si le dossier est une destination valable
 /// </summary>
 /// <param name="dest">Dossier à tester</param>
 /// <returns>Vrai si le dossier est un dossier Animé</returns>
 protected override bool IsGoodDestination(DestinationFolder dest)
 {
     return dest.FolderType == DestinationFolder.Type.All || dest.FolderType == DestinationFolder.Type.Anime;
 }
Example #4
0
 /// <summary>
 /// Détermine si le dossier est un dossier de destination d'animé.
 /// </summary>
 /// <param name="dest">Dossier à tester</param>
 /// <returns>Retourne vrai si le dossier est un dossier valable.</returns>
 public static bool IsAnimeDestination(DestinationFolder dest)
 {
     return dest.FolderType == DestinationFolder.Type.All || dest.FolderType == DestinationFolder.Type.Anime;
 }
Example #5
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);
            }
        }
Example #6
0
 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;
         }
     }
 }