public static void RenameFile(FileTemplate template) { var sourcePath = template.SourcePath; var sourceDir = Path.GetDirectoryName(sourcePath); var newFileName = template.Filename + ".mp3"; var newPath = Path.Combine(Path.GetDirectoryName(sourcePath), newFileName); File.Move(sourcePath, newPath); template.SourcePath = newPath; }
public void StartGettingFilesDescriptors() { var files = GetMp3FilesRecursively(_path).ToList(); for (int i = 0; i < files.Count; i++) { var filePath = files[i]; FileTemplate item = new FileTemplate(filePath); item.Mp3Length = GetMp3Length(filePath); NewFileParsed?.Invoke(this, item); ProgressUpdated?.Invoke(this, GetProgress(i + 1, files.Count)); } }