private List <TaskItem> ExpandArtistFolder(ArtistFolder artistFolder) { var taskList = new List <TaskItem>(); foreach (var folder in artistFolder.GetOpusFolders()) { var l = ExpandOpusFolder(folder.Folderpath, folder.ForSinglesOnly); if (l != null) { taskList.Add(l); } } return(taskList); }
private void GetSelectedArtists(MusicStyles musicStyle, IEnumerable <string> names) { foreach (var name in names) { var af = new ArtistFolder(musicOptions, musicStyle, name); var opusFolders = af.GetOpusFolders(); if (musicStyle == MusicStyles.Popular) { log.Information($"{af} has {opusFolders.Count()} album folders (of which {opusFolders.Where(f => f.ForSinglesOnly).Count()} are for singles only"); } else { log.Information($"{af} has {opusFolders.Count()} album folders"); } foreach (var wf in opusFolders) { var files = wf.GetFilesOnDisk(); if (files.Count() > 0) { log.Information($" {wf}, {files.Count()} music files"); } } } }
private void Catalogue() { void ListFiles(OpusFolder folder) { var files = folder.GetFilesOnDisk(); var partCount = files.Where(x => x.part != null).Select(x => x.part.Number).Distinct().Count(); log.Information($"{(folder.IsCollection ? "Collection" : folder.ArtistName)}, {folder.OpusName}, {folder.Source}, {files.Count()} files in {partCount} parts {(folder.IsGenerated ? ", (generated)" : "")}"); } var names = new string[] { @"D:\Music\flac\Western\Popular\Bruce Springsteen", @"D:\Music\flac\Western\Popular\Elton John", @"D:\Music\flac\Western\Popular\Bruce Springsteen\Born In The USA", @"D:\Music\flac\Western\Popular\Bruce Springsteen\The River", @"D:\Music\flac\Western\Popular\Collections", @"D:\Music\flac\Western\Opera\Collections\The Essential Maria Callas", @"D:\Music\flac\Western\Classical" }; foreach (var name in names) { var pd = MusicMetaDataMethods.GetPathData(musicOptions, name); if (pd?.OpusPath != null) { // single opus folder var folder = new OpusFolder(musicOptions, pd); ListFiles(folder); } else if (pd?.OpusPath == null && (pd?.IsCollections ?? false)) { var cf = new CollectionsFolder(musicOptions, pd.MusicStyle); foreach (var folder in cf.GetOpusFolders()) { ListFiles(folder); } } else if (pd?.OpusPath == null && pd?.ArtistPath != null) { // artist folder var af = new ArtistFolder(musicOptions, pd.MusicStyle, pd.ArtistPath); foreach (var folder in af.GetOpusFolders(name)) { ListFiles(folder); } } else if (pd != null) { //style folder foreach (var af in pd.MusicStyle.GetArtistFolders(musicOptions)) { foreach (var folder in af.GetOpusFolders(name)) { ListFiles(folder); } } foreach (var folder in pd.MusicStyle.GetCollectionsFolder(musicOptions).GetOpusFolders(name)) { ListFiles(folder); } } } }