public void Rename(MP3File file)
 {
     if (CheckPermission(file, _user))
     {
         _renamer.Rename(file);
     }
 }
示例#2
0
 public void CorrectToTag()
 {
     renamer = new TagRenamer();
     renamer.Rename(file);
     Assert.AreEqual("Dog", file.TagArtist);
     Assert.AreEqual("Cat", file.TagTitle);
 }
示例#3
0
 public void CorrectToFileName()
 {
     renamer = new FileNameRenamer();
     renamer.Rename(file);
     Assert.AreEqual("Bob", file.Artist);
     Assert.AreEqual("Lord", file.Title);
 }
示例#4
0
        public void Rename(MP3File file)
        {
            var sw = Stopwatch.StartNew();

            _renamer.Rename(file);
            sw.Stop();
            Elapsed += sw.Elapsed;
        }
示例#5
0
        public FileShell RenameMusicFile(string filePath, string fileArtistTag, string fileTitleTag)
        {
            var parsedFile = _parser.ParseFile(filePath, fileArtistTag, fileTitleTag);

            var fileShell = _shellMaker.MakeFileShell(parsedFile);

            if (Array.Exists(_knownExtensions, (x => x == fileShell.Extension)))
            {
                _renamer.Rename(fileShell);
            }

            _parser.CollectFilePath(fileShell);

            return(fileShell);
        }
示例#6
0
        public int[] Rename()
        {
            int successful = 0;
            int failed     = 0;

            foreach (var file in _finder.GetAllFiles())
            {
                if (_renamer.Rename(file))
                {
                    successful++;
                }
                else
                {
                    failed++;
                }
            }

            return(new[] { successful, failed });
        }