RecordingInfoDto.cs 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. using MediaBrowser.Model.Dto;
  2. using MediaBrowser.Model.Entities;
  3. using MediaBrowser.Model.Extensions;
  4. using MediaBrowser.Model.Library;
  5. using MediaBrowser.Model.Sync;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.ComponentModel;
  9. using System.Diagnostics;
  10. using System.Runtime.Serialization;
  11. namespace MediaBrowser.Model.LiveTv
  12. {
  13. [DebuggerDisplay("Name = {Name}, ChannelName = {ChannelName}")]
  14. public class RecordingInfoDto : IHasPropertyChangedEvent, IItemDto, IHasServerId, IHasSyncInfo
  15. {
  16. /// <summary>
  17. /// Id of the recording.
  18. /// </summary>
  19. public string Id { get; set; }
  20. /// <summary>
  21. /// Gets or sets the primary image aspect ratio.
  22. /// </summary>
  23. /// <value>The primary image aspect ratio.</value>
  24. public double? PrimaryImageAspectRatio { get; set; }
  25. /// <summary>
  26. /// Gets or sets the server identifier.
  27. /// </summary>
  28. /// <value>The server identifier.</value>
  29. public string ServerId { get; set; }
  30. /// <summary>
  31. /// Gets or sets the original primary image aspect ratio.
  32. /// </summary>
  33. /// <value>The original primary image aspect ratio.</value>
  34. public double? OriginalPrimaryImageAspectRatio { get; set; }
  35. /// <summary>
  36. /// Gets or sets a value indicating whether [supports synchronize].
  37. /// </summary>
  38. /// <value><c>null</c> if [supports synchronize] contains no value, <c>true</c> if [supports synchronize]; otherwise, <c>false</c>.</value>
  39. public bool? SupportsSync { get; set; }
  40. /// <summary>
  41. /// Gets or sets a value indicating whether this instance has synchronize job.
  42. /// </summary>
  43. /// <value><c>null</c> if [has synchronize job] contains no value, <c>true</c> if [has synchronize job]; otherwise, <c>false</c>.</value>
  44. public bool? HasSyncJob { get; set; }
  45. /// <summary>
  46. /// Gets or sets a value indicating whether this instance is synced.
  47. /// </summary>
  48. /// <value><c>null</c> if [is synced] contains no value, <c>true</c> if [is synced]; otherwise, <c>false</c>.</value>
  49. public bool? IsSynced { get; set; }
  50. /// <summary>
  51. /// Gets or sets the synchronize status.
  52. /// </summary>
  53. /// <value>The synchronize status.</value>
  54. public SyncJobItemStatus? SyncStatus { get; set; }
  55. /// <summary>
  56. /// Gets or sets the series timer identifier.
  57. /// </summary>
  58. /// <value>The series timer identifier.</value>
  59. public string SeriesTimerId { get; set; }
  60. /// <summary>
  61. /// Gets or sets the external identifier.
  62. /// </summary>
  63. /// <value>The external identifier.</value>
  64. public string ExternalId { get; set; }
  65. /// <summary>
  66. /// Gets or sets the program identifier.
  67. /// </summary>
  68. /// <value>The program identifier.</value>
  69. public string ProgramId { get; set; }
  70. /// <summary>
  71. /// ChannelId of the recording.
  72. /// </summary>
  73. public string ChannelId { get; set; }
  74. /// <summary>
  75. /// Gets or sets the play access.
  76. /// </summary>
  77. /// <value>The play access.</value>
  78. public PlayAccess PlayAccess { get; set; }
  79. /// <summary>
  80. /// Gets or sets the channel primary image tag.
  81. /// </summary>
  82. /// <value>The channel primary image tag.</value>
  83. public string ChannelPrimaryImageTag { get; set; }
  84. /// <summary>
  85. /// ChannelName of the recording.
  86. /// </summary>
  87. public string ChannelName { get; set; }
  88. /// <summary>
  89. /// Gets or sets the name of the service.
  90. /// </summary>
  91. /// <value>The name of the service.</value>
  92. public string ServiceName { get; set; }
  93. /// <summary>
  94. /// Name of the recording.
  95. /// </summary>
  96. public string Name { get; set; }
  97. /// <summary>
  98. /// Gets or sets the media streams.
  99. /// </summary>
  100. /// <value>The media streams.</value>
  101. public List<MediaStream> MediaStreams { get; set; }
  102. /// <summary>
  103. /// Gets or sets the path.
  104. /// </summary>
  105. /// <value>The path.</value>
  106. public string Path { get; set; }
  107. /// <summary>
  108. /// Gets or sets a value indicating whether this instance can delete.
  109. /// </summary>
  110. /// <value><c>null</c> if [can delete] contains no value, <c>true</c> if [can delete]; otherwise, <c>false</c>.</value>
  111. public bool? CanDelete { get; set; }
  112. /// <summary>
  113. /// Overview of the recording.
  114. /// </summary>
  115. public string Overview { get; set; }
  116. /// <summary>
  117. /// The start date of the recording, in UTC.
  118. /// </summary>
  119. public DateTime StartDate { get; set; }
  120. /// <summary>
  121. /// The end date of the recording, in UTC.
  122. /// </summary>
  123. public DateTime EndDate { get; set; }
  124. /// <summary>
  125. /// Gets or sets the original air date.
  126. /// </summary>
  127. /// <value>The original air date.</value>
  128. public DateTime? OriginalAirDate { get; set; }
  129. /// <summary>
  130. /// Gets or sets the status.
  131. /// </summary>
  132. /// <value>The status.</value>
  133. public RecordingStatus Status { get; set; }
  134. /// <summary>
  135. /// Gets or sets the name of the status.
  136. /// </summary>
  137. /// <value>The name of the status.</value>
  138. public string StatusName { get; set; }
  139. /// <summary>
  140. /// Gets or sets the completion percentage.
  141. /// </summary>
  142. /// <value>The completion percentage.</value>
  143. public double? CompletionPercentage { get; set; }
  144. /// <summary>
  145. /// Genre of the program.
  146. /// </summary>
  147. public List<string> Genres { get; set; }
  148. /// <summary>
  149. /// Gets or sets a value indicating whether this instance is repeat.
  150. /// </summary>
  151. /// <value><c>true</c> if this instance is repeat; otherwise, <c>false</c>.</value>
  152. public bool IsRepeat { get; set; }
  153. /// <summary>
  154. /// Gets or sets the episode title.
  155. /// </summary>
  156. /// <value>The episode title.</value>
  157. public string EpisodeTitle { get; set; }
  158. /// <summary>
  159. /// Gets or sets the run time ticks.
  160. /// </summary>
  161. /// <value>The run time ticks.</value>
  162. public long? RunTimeTicks { get; set; }
  163. /// <summary>
  164. /// Gets or sets the type of the media.
  165. /// </summary>
  166. /// <value>The type of the media.</value>
  167. public string MediaType { get; set; }
  168. /// <summary>
  169. /// Gets or sets the type of the channel.
  170. /// </summary>
  171. /// <value>The type of the channel.</value>
  172. public ChannelType ChannelType { get; set; }
  173. /// <summary>
  174. /// Gets or sets the official rating.
  175. /// </summary>
  176. /// <value>The official rating.</value>
  177. public string OfficialRating { get; set; }
  178. /// <summary>
  179. /// Gets or sets the community rating.
  180. /// </summary>
  181. /// <value>The community rating.</value>
  182. public float? CommunityRating { get; set; }
  183. /// <summary>
  184. /// Gets or sets a value indicating whether this instance is hd.
  185. /// </summary>
  186. /// <value><c>true</c> if this instance is hd; otherwise, <c>false</c>.</value>
  187. public bool? IsHD { get; set; }
  188. /// <summary>
  189. /// Gets or sets the audio.
  190. /// </summary>
  191. /// <value>The audio.</value>
  192. public ProgramAudio? Audio { get; set; }
  193. /// <summary>
  194. /// Gets or sets a value indicating whether this instance is movie.
  195. /// </summary>
  196. /// <value><c>true</c> if this instance is movie; otherwise, <c>false</c>.</value>
  197. public bool IsMovie { get; set; }
  198. /// <summary>
  199. /// Gets or sets a value indicating whether this instance is sports.
  200. /// </summary>
  201. /// <value><c>true</c> if this instance is sports; otherwise, <c>false</c>.</value>
  202. public bool IsSports { get; set; }
  203. /// <summary>
  204. /// Gets or sets a value indicating whether this instance is series.
  205. /// </summary>
  206. /// <value><c>true</c> if this instance is series; otherwise, <c>false</c>.</value>
  207. public bool IsSeries { get; set; }
  208. /// <summary>
  209. /// Gets or sets a value indicating whether this instance is live.
  210. /// </summary>
  211. /// <value><c>true</c> if this instance is live; otherwise, <c>false</c>.</value>
  212. public bool IsLive { get; set; }
  213. /// <summary>
  214. /// Gets or sets a value indicating whether this instance is news.
  215. /// </summary>
  216. /// <value><c>true</c> if this instance is news; otherwise, <c>false</c>.</value>
  217. public bool IsNews { get; set; }
  218. /// <summary>
  219. /// Gets or sets a value indicating whether this instance is kids.
  220. /// </summary>
  221. /// <value><c>true</c> if this instance is kids; otherwise, <c>false</c>.</value>
  222. public bool IsKids { get; set; }
  223. /// <summary>
  224. /// Gets or sets a value indicating whether this instance is premiere.
  225. /// </summary>
  226. /// <value><c>true</c> if this instance is premiere; otherwise, <c>false</c>.</value>
  227. public bool IsPremiere { get; set; }
  228. /// <summary>
  229. /// Gets or sets the image tags.
  230. /// </summary>
  231. /// <value>The image tags.</value>
  232. public Dictionary<ImageType, string> ImageTags { get; set; }
  233. /// <summary>
  234. /// Gets or sets the user data.
  235. /// </summary>
  236. /// <value>The user data.</value>
  237. public UserItemDataDto UserData { get; set; }
  238. /// <summary>
  239. /// Gets a value indicating whether this instance has primary image.
  240. /// </summary>
  241. /// <value><c>true</c> if this instance has primary image; otherwise, <c>false</c>.</value>
  242. [IgnoreDataMember]
  243. public bool HasPrimaryImage
  244. {
  245. get { return ImageTags != null && ImageTags.ContainsKey(ImageType.Primary); }
  246. }
  247. /// <summary>
  248. /// Gets or sets the type.
  249. /// </summary>
  250. /// <value>The type.</value>
  251. public string Type { get; set; }
  252. /// <summary>
  253. /// Gets or sets the media sources.
  254. /// </summary>
  255. /// <value>The media sources.</value>
  256. public List<MediaSourceInfo> MediaSources { get; set; }
  257. public RecordingInfoDto()
  258. {
  259. Genres = new List<string>();
  260. ImageTags = new Dictionary<ImageType, string>();
  261. MediaSources = new List<MediaSourceInfo>();
  262. }
  263. public event PropertyChangedEventHandler PropertyChanged;
  264. }
  265. }