protected override async Task LoadMusicTags() { var json = await ReadMusicTagJson(); if (json != null) { var teo = json.ToInstance <WesternClassicalAlbumTEO>(); performanceTEO = teo.PerformanceList.Single(x => x.MovementFilenames.All(f => MusicFiles.Select(mf => mf.File).SingleOrDefault(x => x.EndsWith(f, System.Globalization.CompareOptions.IgnoreCase)) != null) ); ComposerName = performanceTEO.ComposerTag.GetValue <string>(); CompositionName = performanceTEO.CompositionTag.GetValue <string>(); orchestras = performanceTEO.OrchestraTag.GetValues <string>(); conductors = performanceTEO.ConductorTag.GetValues <string>(); otherPerformers = performanceTEO.PerformerTag.GetValues <string>(); } }
protected override void LoadTags() { //now group music files and load performances var groupedByComposition = TrackList.Cast <WesternClassicalMusicFileTEO>().GroupBy(k => k.CompositionTag.Values.First().Value); var result = new List <PerformanceTEO>(); var tagValueComparer = new TagValueComparer(); foreach (var group in groupedByComposition.OrderBy(x => x.Key)) { var movementFilenames = group .Select(x => x.File); var teo = new PerformanceTEO(musicOptions); teo.LoadTags(movementFilenames, TrackList.Cast <WesternClassicalMusicFileTEO>()); result.Add(teo); } PerformanceList = result; }