ChannelInfoDto.cs 4.0 KB

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