ChannelInfoDto.cs 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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. public List<MediaSourceInfo> MediaSources { get; set; }
  32. /// <summary>
  33. /// Gets or sets the image tags.
  34. /// </summary>
  35. /// <value>The image tags.</value>
  36. public Dictionary<ImageType, string> ImageTags { get; set; }
  37. /// <summary>
  38. /// Gets or sets the number.
  39. /// </summary>
  40. /// <value>The number.</value>
  41. public string Number { get; set; }
  42. /// <summary>
  43. /// Gets or sets the play access.
  44. /// </summary>
  45. /// <value>The play access.</value>
  46. public PlayAccess PlayAccess { get; set; }
  47. /// <summary>
  48. /// Gets or sets the name of the service.
  49. /// </summary>
  50. /// <value>The name of the service.</value>
  51. public string ServiceName { get; set; }
  52. /// <summary>
  53. /// Gets or sets the type of the channel.
  54. /// </summary>
  55. /// <value>The type of the channel.</value>
  56. public LiveTvChannelType ChannelType { get; set; }
  57. /// <summary>
  58. /// Gets or sets the type.
  59. /// </summary>
  60. /// <value>The type.</value>
  61. public string Type { get; set; }
  62. /// <summary>
  63. /// Gets or sets the type of the media.
  64. /// </summary>
  65. /// <value>The type of the media.</value>
  66. public string MediaType { get; set; }
  67. /// <summary>
  68. /// Gets or sets the user data.
  69. /// </summary>
  70. /// <value>The user data.</value>
  71. public UserItemDataDto UserData { get; set; }
  72. /// <summary>
  73. /// Gets or sets the now playing program.
  74. /// </summary>
  75. /// <value>The now playing program.</value>
  76. public ProgramInfoDto CurrentProgram { get; set; }
  77. /// <summary>
  78. /// Gets or sets the primary image aspect ratio, after image enhancements.
  79. /// </summary>
  80. /// <value>The primary image aspect ratio.</value>
  81. public double? PrimaryImageAspectRatio { get; set; }
  82. /// <summary>
  83. /// Gets or sets the primary image aspect ratio, before image enhancements.
  84. /// </summary>
  85. /// <value>The original primary image aspect ratio.</value>
  86. public double? OriginalPrimaryImageAspectRatio { get; set; }
  87. /// <summary>
  88. /// Gets a value indicating whether this instance has primary image.
  89. /// </summary>
  90. /// <value><c>true</c> if this instance has primary image; otherwise, <c>false</c>.</value>
  91. [IgnoreDataMember]
  92. public bool HasPrimaryImage
  93. {
  94. get { return ImageTags != null && ImageTags.ContainsKey(ImageType.Primary); }
  95. }
  96. public ChannelInfoDto()
  97. {
  98. ImageTags = new Dictionary<ImageType, string>();
  99. MediaSources = new List<MediaSourceInfo>();
  100. }
  101. public event PropertyChangedEventHandler PropertyChanged;
  102. }
  103. }