Example #1
0
 private void Rename(List<string> filePaths, IFileBot fileBot,
     List<Renaming> renamings, string dropfolder, List<string> irgnoredPaths )
 {
     foreach (var filePath in filePaths)
     {
         var newFileName = String.Empty;
         if (!irgnoredPaths.Contains(filePath))
         {
             if (fileBot.Rename(filePath, out newFileName))
             {
                 var renaming = pathGenerator.GenerateNewPath(filePath, newFileName, dropfolder);
                 archiver.ArchiveExisting(renaming.NewPath);
                 if (fileMover.Move(renaming.RenamedPath, renaming.NewPath))
                 {
                     renamings.Add(renaming);
                     cleaner.Cleanup(renaming);
                 }
             }
             else
             {
                 irgnoredPaths.Add(filePath);
             }
         }
        
     }
 }
Example #2
0
 public Renamer()
 {
     this.logger = new Logger();
     this.settings = new Settings(logger);
     this.fileSearcher = new FileSearcher(settings, logger);
     this.movieFileBot = new FileBot(settings, logger, true);
     this.seriesFileBot = new FileBot(settings, logger, false);
     this.cleaner = new Cleaner(settings, fileSearcher, logger);
     this.pathGenerator = new PathGenerator();
     this.fileMover = new FileMover(logger);
     this.cleaner = new Cleaner(settings, fileSearcher, logger);
     this.archiver = new Archiver(settings, fileMover);
 }