private void CreateFile(string rootPath, MediaFile file) { if (!Directory.Exists(rootPath)) { Directory.CreateDirectory(rootPath); } string artistPath = rootPath + Song.Artist + "\\"; if (!Directory.Exists(artistPath)) { Directory.CreateDirectory(artistPath); } string albumPath = artistPath + Song.Album + "\\"; if (!Directory.Exists(albumPath)) { Directory.CreateDirectory(albumPath); } string fullPath = albumPath + Song.Title + ".mp3"; File.WriteAllBytes(fullPath, file.Content); }
public UploadTask(Song song, MediaFile mediaFile) { Song = song; MediaFile = mediaFile; }