ChannelInfoDto.cs 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. using MediaBrowser.Model.Dto;
  2. using MediaBrowser.Model.Entities;
  3. using MediaBrowser.Model.Library;
  4. using System.Collections.Generic;
  5. using System.Diagnostics;
  6. using MediaBrowser.Model.Serialization;
  7. namespace MediaBrowser.Model.LiveTv
  8. {
  9. /// <summary>
  10. /// Class ChannelInfoDto
  11. /// </summary>
  12. [DebuggerDisplay("Name = {Name}, Number = {Number}")]
  13. public class ChannelInfoDto : IItemDto, IHasServerId
  14. {
  15. /// <summary>
  16. /// Gets or sets the name.
  17. /// </summary>
  18. /// <value>The name.</value>
  19. public string Name { get; set; }
  20. /// <summary>
  21. /// Gets or sets the server identifier.
  22. /// </summary>
  23. /// <value>The server identifier.</value>
  24. public string ServerId { get; set; }
  25. /// <summary>
  26. /// Gets or sets the identifier.
  27. /// </summary>
  28. /// <value>The identifier.</value>
  29. public string Id { get; set; }
  30. /// <summary>
  31. /// Gets or sets the external identifier.
  32. /// </summary>
  33. /// <value>The external identifier.</value>
  34. public string ExternalId { get; set; }
  35. /// <summary>
  36. /// Gets or sets the media sources.
  37. /// </summary>
  38. /// <value>The media sources.</value>
  39. public List<MediaSourceInfo> MediaSources { get; set; }
  40. /// <summary>
  41. /// Gets or sets the image tags.
  42. /// </summary>
  43. /// <value>The image tags.</value>
  44. public Dictionary<ImageType, string> ImageTags { get; set; }
  45. /// <summary>
  46. /// Gets or sets the number.
  47. /// </summary>
  48. /// <value>The number.</value>
  49. public string Number { get; set; }
  50. /// <summary>
  51. /// Gets or sets the play access.
  52. /// </summary>
  53. /// <value>The play access.</value>
  54. public PlayAccess PlayAccess { get; set; }
  55. /// <summary>
  56. /// Gets or sets the name of the service.
  57. /// </summary>
  58. /// <value>The name of the service.</value>
  59. public string ServiceName { get; set; }
  60. /// <summary>
  61. /// Gets or sets the type of the channel.
  62. /// </summary>
  63. /// <value>The type of the channel.</value>
  64. public ChannelType ChannelType { get; set; }
  65. /// <summary>
  66. /// Gets or sets the type.
  67. /// </summary>
  68. /// <value>The type.</value>
  69. public string Type { get; set; }
  70. /// <summary>
  71. /// Gets or sets the type of the media.
  72. /// </summary>
  73. /// <value>The type of the media.</value>
  74. public string MediaType { get; set; }
  75. /// <summary>
  76. /// Gets or sets the user data.
  77. /// </summary>
  78. /// <value>The user data.</value>
  79. public UserItemDataDto UserData { get; set; }
  80. /// <summary>
  81. /// Gets or sets the now playing program.
  82. /// </summary>
  83. /// <value>The now playing program.</value>
  84. public BaseItemDto CurrentProgram { get; set; }
  85. /// <summary>
  86. /// Gets or sets the primary image aspect ratio, after image enhancements.
  87. /// </summary>
  88. /// <value>The primary image aspect ratio.</value>
  89. public double? PrimaryImageAspectRatio { get; set; }
  90. /// <summary>
  91. /// Gets a value indicating whether this instance has primary image.
  92. /// </summary>
  93. /// <value><c>true</c> if this instance has primary image; otherwise, <c>false</c>.</value>
  94. [IgnoreDataMember]
  95. public bool HasPrimaryImage
  96. {
  97. get { return ImageTags != null && ImageTags.ContainsKey(ImageType.Primary); }
  98. }
  99. public ChannelInfoDto()
  100. {
  101. ImageTags = new Dictionary<ImageType, string>();
  102. MediaSources = new List<MediaSourceInfo>();
  103. }
  104. }
  105. }