ChannelInfoDto.cs 3.8 KB

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