public void Rename(MP3File file) { if (CheckPermission(file, _user)) { _renamer.Rename(file); } }
public void CorrectToTag() { renamer = new TagRenamer(); renamer.Rename(file); Assert.AreEqual("Dog", file.TagArtist); Assert.AreEqual("Cat", file.TagTitle); }
public void CorrectToFileName() { renamer = new FileNameRenamer(); renamer.Rename(file); Assert.AreEqual("Bob", file.Artist); Assert.AreEqual("Lord", file.Title); }
public void Rename(MP3File file) { var sw = Stopwatch.StartNew(); _renamer.Rename(file); sw.Stop(); Elapsed += sw.Elapsed; }
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); }
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 }); }