MetaDataWrap.cs 649 B

123456789101112131415
  1. namespace Bmp.Core.Lite.Metadata;
  2. public class MetaDataWrap
  3. {
  4. public IReadOnlyDictionary<string, string>? RawTags { get; init; }
  5. public TimeSpan Duration { get; init; }
  6. public string? Title => RawTags?.TryGetValue("TITLE", out var text) == true ? text : null;
  7. public string? Artist => RawTags?.TryGetValue("ARTIST", out var text) == true ? text : null;
  8. public string? Album => RawTags?.TryGetValue("ALBUM", out var text) == true ? text : null;
  9. //TODO: MetaData TrackNo track xx/yy
  10. public int? TrackNo => RawTags?.TryGetValue("track", out var num) == true ? int.TryParse(num, out var track) ? track : null : null;
  11. }