ChannelInfoDto.cs 4.2 KB

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