Пример #1
0
        void LoadMetadata(IFile file)
        {
            m_Logger.Info($"Loading metadata for file '{file.FullPath}'");

            using (var audioFile = new AudioFile(file.FullPath))
            {
                var tag = audioFile.GetTag(TagTypes.Id3v2);

                var track = m_MetadataFactory.GetTrack(
                    tag.AlbumArtists != null && tag.AlbumArtists.Any() ? tag.AlbumArtists.Aggregate((a, b) => $"{a}/{b}") : "",
                    tag.Album,
                    (int)tag.Year,
                    (int)tag.Disc,
                    (int)tag.Track,
                    tag.Title,
                    tag.Performers != null && tag.Performers.Any() ? tag.Performers.Aggregate((a, b) => $"{a}/{b}") : "");

                m_FileMetadataMapper.AddMapping(track, file);
            }
        }