Audio.cs 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. using MediaBrowser.Model.Entities;
  2. using System.Collections.Generic;
  3. using System.Runtime.Serialization;
  4. namespace MediaBrowser.Controller.Entities.Audio
  5. {
  6. /// <summary>
  7. /// Class Audio
  8. /// </summary>
  9. public class Audio : BaseItem, IHasMediaStreams
  10. {
  11. /// <summary>
  12. /// Gets or sets the media streams.
  13. /// </summary>
  14. /// <value>The media streams.</value>
  15. public List<MediaStream> MediaStreams { get; set; }
  16. /// <summary>
  17. /// Override this to true if class should be grouped under a container in indicies
  18. /// The container class should be defined via IndexContainer
  19. /// </summary>
  20. /// <value><c>true</c> if [group in index]; otherwise, <c>false</c>.</value>
  21. [IgnoreDataMember]
  22. public override bool GroupInIndex
  23. {
  24. get
  25. {
  26. return true;
  27. }
  28. }
  29. /// <summary>
  30. /// The unknown album
  31. /// </summary>
  32. private static readonly MusicAlbum UnknownAlbum = new MusicAlbum {Name = "<Unknown>"};
  33. /// <summary>
  34. /// Override this to return the folder that should be used to construct a container
  35. /// for this item in an index. GroupInIndex should be true as well.
  36. /// </summary>
  37. /// <value>The index container.</value>
  38. [IgnoreDataMember]
  39. public override Folder IndexContainer
  40. {
  41. get
  42. {
  43. return Parent is MusicAlbum ? Parent : Album != null ? new MusicAlbum {Name = Album, PrimaryImagePath = PrimaryImagePath } : UnknownAlbum;
  44. }
  45. }
  46. /// <summary>
  47. /// Gets or sets the artist.
  48. /// </summary>
  49. /// <value>The artist.</value>
  50. public string Artist { get; set; }
  51. /// <summary>
  52. /// Gets or sets the album.
  53. /// </summary>
  54. /// <value>The album.</value>
  55. public string Album { get; set; }
  56. /// <summary>
  57. /// Gets or sets the album artist.
  58. /// </summary>
  59. /// <value>The album artist.</value>
  60. public string AlbumArtist { get; set; }
  61. /// <summary>
  62. /// Gets the type of the media.
  63. /// </summary>
  64. /// <value>The type of the media.</value>
  65. public override string MediaType
  66. {
  67. get
  68. {
  69. return Model.Entities.MediaType.Audio;
  70. }
  71. }
  72. }
  73. }