BaseItemDto.cs 40 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190
  1. using MediaBrowser.Model.Drawing;
  2. using MediaBrowser.Model.Entities;
  3. using MediaBrowser.Model.Extensions;
  4. using MediaBrowser.Model.Library;
  5. using MediaBrowser.Model.LiveTv;
  6. using MediaBrowser.Model.Providers;
  7. using MediaBrowser.Model.Sync;
  8. using System;
  9. using System.Collections.Generic;
  10. using System.ComponentModel;
  11. using System.Diagnostics;
  12. using System.Runtime.Serialization;
  13. namespace MediaBrowser.Model.Dto
  14. {
  15. /// <summary>
  16. /// This is strictly used as a data transfer object from the api layer.
  17. /// This holds information about a BaseItem in a format that is convenient for the client.
  18. /// </summary>
  19. [DebuggerDisplay("Name = {Name}, ID = {Id}, Type = {Type}")]
  20. public class BaseItemDto : IHasProviderIds, IHasPropertyChangedEvent, IItemDto, IHasServerId, IHasSyncInfo
  21. {
  22. /// <summary>
  23. /// Gets or sets the name.
  24. /// </summary>
  25. /// <value>The name.</value>
  26. public string Name { get; set; }
  27. /// <summary>
  28. /// Gets or sets the server identifier.
  29. /// </summary>
  30. /// <value>The server identifier.</value>
  31. public string ServerId { get; set; }
  32. /// <summary>
  33. /// Gets or sets the id.
  34. /// </summary>
  35. /// <value>The id.</value>
  36. public string Id { get; set; }
  37. /// <summary>
  38. /// Gets or sets the etag.
  39. /// </summary>
  40. /// <value>The etag.</value>
  41. public string Etag { get; set; }
  42. /// <summary>
  43. /// Gets or sets the playlist item identifier.
  44. /// </summary>
  45. /// <value>The playlist item identifier.</value>
  46. public string PlaylistItemId { get; set; }
  47. /// <summary>
  48. /// Gets or sets the date created.
  49. /// </summary>
  50. /// <value>The date created.</value>
  51. public DateTime? DateCreated { get; set; }
  52. public DateTime? DateLastMediaAdded { get; set; }
  53. public ExtraType? ExtraType { get; set; }
  54. public int? AirsBeforeSeasonNumber { get; set; }
  55. public int? AirsAfterSeasonNumber { get; set; }
  56. public int? AirsBeforeEpisodeNumber { get; set; }
  57. public int? AbsoluteEpisodeNumber { get; set; }
  58. public bool? DisplaySpecialsWithSeasons { get; set; }
  59. public bool? CanDelete { get; set; }
  60. public bool? CanDownload { get; set; }
  61. public string PreferredMetadataLanguage { get; set; }
  62. public string PreferredMetadataCountryCode { get; set; }
  63. public string AwardSummary { get; set; }
  64. public string ShareUrl { get; set; }
  65. public float? Metascore { get; set; }
  66. public bool? IsUnidentified { get; set; }
  67. public bool? HasDynamicCategories { get; set; }
  68. public int? AnimeSeriesIndex { get; set; }
  69. /// <summary>
  70. /// Gets or sets a value indicating whether [supports synchronize].
  71. /// </summary>
  72. /// <value><c>null</c> if [supports synchronize] contains no value, <c>true</c> if [supports synchronize]; otherwise, <c>false</c>.</value>
  73. public bool? SupportsSync { get; set; }
  74. /// <summary>
  75. /// Gets or sets a value indicating whether this instance has synchronize job.
  76. /// </summary>
  77. /// <value><c>null</c> if [has synchronize job] contains no value, <c>true</c> if [has synchronize job]; otherwise, <c>false</c>.</value>
  78. public bool? HasSyncJob { get; set; }
  79. /// <summary>
  80. /// Gets or sets a value indicating whether this instance is synced.
  81. /// </summary>
  82. /// <value><c>null</c> if [is synced] contains no value, <c>true</c> if [is synced]; otherwise, <c>false</c>.</value>
  83. public bool? IsSynced { get; set; }
  84. /// <summary>
  85. /// Gets or sets the synchronize status.
  86. /// </summary>
  87. /// <value>The synchronize status.</value>
  88. public SyncJobItemStatus? SyncStatus { get; set; }
  89. /// <summary>
  90. /// Gets or sets the synchronize percent.
  91. /// </summary>
  92. /// <value>The synchronize percent.</value>
  93. public double? SyncPercent { get; set; }
  94. /// <summary>
  95. /// Gets or sets the DVD season number.
  96. /// </summary>
  97. /// <value>The DVD season number.</value>
  98. public int? DvdSeasonNumber { get; set; }
  99. /// <summary>
  100. /// Gets or sets the DVD episode number.
  101. /// </summary>
  102. /// <value>The DVD episode number.</value>
  103. public float? DvdEpisodeNumber { get; set; }
  104. /// <summary>
  105. /// Gets or sets the name of the sort.
  106. /// </summary>
  107. /// <value>The name of the sort.</value>
  108. public string SortName { get; set; }
  109. public string ForcedSortName { get; set; }
  110. /// <summary>
  111. /// Gets or sets the video3 D format.
  112. /// </summary>
  113. /// <value>The video3 D format.</value>
  114. public Video3DFormat? Video3DFormat { get; set; }
  115. /// <summary>
  116. /// Gets or sets the premiere date.
  117. /// </summary>
  118. /// <value>The premiere date.</value>
  119. public DateTime? PremiereDate { get; set; }
  120. /// <summary>
  121. /// Gets or sets the external urls.
  122. /// </summary>
  123. /// <value>The external urls.</value>
  124. public ExternalUrl[] ExternalUrls { get; set; }
  125. /// <summary>
  126. /// Gets or sets the media versions.
  127. /// </summary>
  128. /// <value>The media versions.</value>
  129. public List<MediaSourceInfo> MediaSources { get; set; }
  130. /// <summary>
  131. /// Gets or sets the critic rating.
  132. /// </summary>
  133. /// <value>The critic rating.</value>
  134. public float? CriticRating { get; set; }
  135. /// <summary>
  136. /// Gets or sets the game system.
  137. /// </summary>
  138. /// <value>The game system.</value>
  139. public string GameSystem { get; set; }
  140. /// <summary>
  141. /// Gets or sets the critic rating summary.
  142. /// </summary>
  143. /// <value>The critic rating summary.</value>
  144. public string CriticRatingSummary { get; set; }
  145. public List<string> MultiPartGameFiles { get; set; }
  146. /// <summary>
  147. /// Gets or sets the path.
  148. /// </summary>
  149. /// <value>The path.</value>
  150. public string Path { get; set; }
  151. /// <summary>
  152. /// Gets or sets the official rating.
  153. /// </summary>
  154. /// <value>The official rating.</value>
  155. public string OfficialRating { get; set; }
  156. /// <summary>
  157. /// Gets or sets the custom rating.
  158. /// </summary>
  159. /// <value>The custom rating.</value>
  160. public string CustomRating { get; set; }
  161. /// <summary>
  162. /// Gets or sets the channel identifier.
  163. /// </summary>
  164. /// <value>The channel identifier.</value>
  165. public string ChannelId { get; set; }
  166. public string ChannelName { get; set; }
  167. /// <summary>
  168. /// Gets or sets the overview.
  169. /// </summary>
  170. /// <value>The overview.</value>
  171. public string Overview { get; set; }
  172. /// <summary>
  173. /// Gets or sets the short overview.
  174. /// </summary>
  175. /// <value>The short overview.</value>
  176. public string ShortOverview { get; set; }
  177. /// <summary>
  178. /// Gets or sets the name of the TMDB collection.
  179. /// </summary>
  180. /// <value>The name of the TMDB collection.</value>
  181. public string TmdbCollectionName { get; set; }
  182. /// <summary>
  183. /// Gets or sets the taglines.
  184. /// </summary>
  185. /// <value>The taglines.</value>
  186. public List<string> Taglines { get; set; }
  187. /// <summary>
  188. /// Gets or sets the genres.
  189. /// </summary>
  190. /// <value>The genres.</value>
  191. public List<string> Genres { get; set; }
  192. /// <summary>
  193. /// Gets or sets the series genres.
  194. /// </summary>
  195. /// <value>The series genres.</value>
  196. public List<string> SeriesGenres { get; set; }
  197. /// <summary>
  198. /// Gets or sets the community rating.
  199. /// </summary>
  200. /// <value>The community rating.</value>
  201. public float? CommunityRating { get; set; }
  202. /// <summary>
  203. /// Gets or sets the vote count.
  204. /// </summary>
  205. /// <value>The vote count.</value>
  206. public int? VoteCount { get; set; }
  207. /// <summary>
  208. /// Gets or sets the cumulative run time ticks.
  209. /// </summary>
  210. /// <value>The cumulative run time ticks.</value>
  211. public long? CumulativeRunTimeTicks { get; set; }
  212. /// <summary>
  213. /// Gets or sets the original run time ticks.
  214. /// </summary>
  215. /// <value>The original run time ticks.</value>
  216. public long? OriginalRunTimeTicks { get; set; }
  217. /// <summary>
  218. /// Gets or sets the run time ticks.
  219. /// </summary>
  220. /// <value>The run time ticks.</value>
  221. public long? RunTimeTicks { get; set; }
  222. /// <summary>
  223. /// Gets or sets the play access.
  224. /// </summary>
  225. /// <value>The play access.</value>
  226. public PlayAccess PlayAccess { get; set; }
  227. /// <summary>
  228. /// Gets or sets the aspect ratio.
  229. /// </summary>
  230. /// <value>The aspect ratio.</value>
  231. public string AspectRatio { get; set; }
  232. /// <summary>
  233. /// Gets or sets the production year.
  234. /// </summary>
  235. /// <value>The production year.</value>
  236. public int? ProductionYear { get; set; }
  237. /// <summary>
  238. /// Gets or sets the season count.
  239. /// </summary>
  240. /// <value>The season count.</value>
  241. public int? SeasonCount { get; set; }
  242. /// <summary>
  243. /// Gets or sets the players supported by a game.
  244. /// </summary>
  245. /// <value>The players.</value>
  246. public int? Players { get; set; }
  247. /// <summary>
  248. /// Gets or sets a value indicating whether this instance is place holder.
  249. /// </summary>
  250. /// <value><c>null</c> if [is place holder] contains no value, <c>true</c> if [is place holder]; otherwise, <c>false</c>.</value>
  251. public bool? IsPlaceHolder { get; set; }
  252. /// <summary>
  253. /// Gets or sets the index number.
  254. /// </summary>
  255. /// <value>The index number.</value>
  256. public int? IndexNumber { get; set; }
  257. /// <summary>
  258. /// Gets or sets the index number end.
  259. /// </summary>
  260. /// <value>The index number end.</value>
  261. public int? IndexNumberEnd { get; set; }
  262. /// <summary>
  263. /// Gets or sets the parent index number.
  264. /// </summary>
  265. /// <value>The parent index number.</value>
  266. public int? ParentIndexNumber { get; set; }
  267. /// <summary>
  268. /// Gets or sets the trailer urls.
  269. /// </summary>
  270. /// <value>The trailer urls.</value>
  271. public List<MediaUrl> RemoteTrailers { get; set; }
  272. /// <summary>
  273. /// Gets or sets the soundtrack ids.
  274. /// </summary>
  275. /// <value>The soundtrack ids.</value>
  276. public string[] SoundtrackIds { get; set; }
  277. /// <summary>
  278. /// Gets or sets the provider ids.
  279. /// </summary>
  280. /// <value>The provider ids.</value>
  281. public Dictionary<string, string> ProviderIds { get; set; }
  282. /// <summary>
  283. /// Gets or sets a value indicating whether this instance is HD.
  284. /// </summary>
  285. /// <value><c>null</c> if [is HD] contains no value, <c>true</c> if [is HD]; otherwise, <c>false</c>.</value>
  286. public bool? IsHD { get; set; }
  287. /// <summary>
  288. /// Gets or sets a value indicating whether this instance is folder.
  289. /// </summary>
  290. /// <value><c>true</c> if this instance is folder; otherwise, <c>false</c>.</value>
  291. public bool IsFolder { get; set; }
  292. /// <summary>
  293. /// Gets or sets the parent id.
  294. /// </summary>
  295. /// <value>The parent id.</value>
  296. public string ParentId { get; set; }
  297. /// <summary>
  298. /// Gets or sets the type.
  299. /// </summary>
  300. /// <value>The type.</value>
  301. public string Type { get; set; }
  302. /// <summary>
  303. /// Gets or sets the people.
  304. /// </summary>
  305. /// <value>The people.</value>
  306. public BaseItemPerson[] People { get; set; }
  307. /// <summary>
  308. /// Gets or sets the studios.
  309. /// </summary>
  310. /// <value>The studios.</value>
  311. public StudioDto[] Studios { get; set; }
  312. /// <summary>
  313. /// If the item does not have a logo, this will hold the Id of the Parent that has one.
  314. /// </summary>
  315. /// <value>The parent logo item id.</value>
  316. public string ParentLogoItemId { get; set; }
  317. /// <summary>
  318. /// If the item does not have any backdrops, this will hold the Id of the Parent that has one.
  319. /// </summary>
  320. /// <value>The parent backdrop item id.</value>
  321. public string ParentBackdropItemId { get; set; }
  322. /// <summary>
  323. /// Gets or sets the parent backdrop image tags.
  324. /// </summary>
  325. /// <value>The parent backdrop image tags.</value>
  326. public List<string> ParentBackdropImageTags { get; set; }
  327. /// <summary>
  328. /// Gets or sets the local trailer count.
  329. /// </summary>
  330. /// <value>The local trailer count.</value>
  331. public int? LocalTrailerCount { get; set; }
  332. /// <summary>
  333. /// User data for this item based on the user it's being requested for
  334. /// </summary>
  335. /// <value>The user data.</value>
  336. public UserItemDataDto UserData { get; set; }
  337. /// <summary>
  338. /// Gets or sets the season user data.
  339. /// </summary>
  340. /// <value>The season user data.</value>
  341. public UserItemDataDto SeasonUserData { get; set; }
  342. /// <summary>
  343. /// Gets or sets the recursive item count.
  344. /// </summary>
  345. /// <value>The recursive item count.</value>
  346. public int? RecursiveItemCount { get; set; }
  347. /// <summary>
  348. /// Gets or sets the child count.
  349. /// </summary>
  350. /// <value>The child count.</value>
  351. public int? ChildCount { get; set; }
  352. /// <summary>
  353. /// Gets or sets the name of the series.
  354. /// </summary>
  355. /// <value>The name of the series.</value>
  356. public string SeriesName { get; set; }
  357. /// <summary>
  358. /// Gets or sets the series id.
  359. /// </summary>
  360. /// <value>The series id.</value>
  361. public string SeriesId { get; set; }
  362. /// <summary>
  363. /// Gets or sets the season identifier.
  364. /// </summary>
  365. /// <value>The season identifier.</value>
  366. public string SeasonId { get; set; }
  367. /// <summary>
  368. /// Gets or sets the special feature count.
  369. /// </summary>
  370. /// <value>The special feature count.</value>
  371. public int? SpecialFeatureCount { get; set; }
  372. /// <summary>
  373. /// Gets or sets the display preferences id.
  374. /// </summary>
  375. /// <value>The display preferences id.</value>
  376. public string DisplayPreferencesId { get; set; }
  377. /// <summary>
  378. /// Gets or sets the status.
  379. /// </summary>
  380. /// <value>The status.</value>
  381. public string Status { get; set; }
  382. [IgnoreDataMember]
  383. public SeriesStatus? SeriesStatus
  384. {
  385. get
  386. {
  387. if (string.IsNullOrEmpty(Status))
  388. {
  389. return null;
  390. }
  391. return (SeriesStatus)Enum.Parse(typeof(SeriesStatus), Status, true);
  392. }
  393. set
  394. {
  395. if (value == null)
  396. {
  397. Status = null;
  398. }
  399. else
  400. {
  401. Status = value.Value.ToString();
  402. }
  403. }
  404. }
  405. [IgnoreDataMember]
  406. public RecordingStatus? RecordingStatus
  407. {
  408. get
  409. {
  410. if (string.IsNullOrEmpty(Status))
  411. {
  412. return null;
  413. }
  414. return (RecordingStatus)Enum.Parse(typeof(RecordingStatus), Status, true);
  415. }
  416. set
  417. {
  418. if (value == null)
  419. {
  420. Status = null;
  421. }
  422. else
  423. {
  424. Status = value.Value.ToString();
  425. }
  426. }
  427. }
  428. /// <summary>
  429. /// Gets or sets the air time.
  430. /// </summary>
  431. /// <value>The air time.</value>
  432. public string AirTime { get; set; }
  433. /// <summary>
  434. /// Gets or sets the air days.
  435. /// </summary>
  436. /// <value>The air days.</value>
  437. public List<DayOfWeek> AirDays { get; set; }
  438. /// <summary>
  439. /// Gets or sets the index options.
  440. /// </summary>
  441. /// <value>The index options.</value>
  442. public string[] IndexOptions { get; set; }
  443. /// <summary>
  444. /// Gets or sets the tags.
  445. /// </summary>
  446. /// <value>The tags.</value>
  447. public List<string> Tags { get; set; }
  448. /// <summary>
  449. /// Gets or sets the keywords.
  450. /// </summary>
  451. /// <value>The keywords.</value>
  452. public List<string> Keywords { get; set; }
  453. /// <summary>
  454. /// Gets or sets the primary image aspect ratio, after image enhancements.
  455. /// </summary>
  456. /// <value>The primary image aspect ratio.</value>
  457. public double? PrimaryImageAspectRatio { get; set; }
  458. /// <summary>
  459. /// Gets or sets the primary image aspect ratio, before image enhancements.
  460. /// </summary>
  461. /// <value>The original primary image aspect ratio.</value>
  462. public double? OriginalPrimaryImageAspectRatio { get; set; }
  463. /// <summary>
  464. /// Gets or sets the artists.
  465. /// </summary>
  466. /// <value>The artists.</value>
  467. public List<string> Artists { get; set; }
  468. /// <summary>
  469. /// Gets or sets the artist items.
  470. /// </summary>
  471. /// <value>The artist items.</value>
  472. public List<NameIdPair> ArtistItems { get; set; }
  473. /// <summary>
  474. /// Gets or sets the album.
  475. /// </summary>
  476. /// <value>The album.</value>
  477. public string Album { get; set; }
  478. /// <summary>
  479. /// Gets or sets the type of the collection.
  480. /// </summary>
  481. /// <value>The type of the collection.</value>
  482. public string CollectionType { get; set; }
  483. /// <summary>
  484. /// Gets or sets the display order.
  485. /// </summary>
  486. /// <value>The display order.</value>
  487. public string DisplayOrder { get; set; }
  488. /// <summary>
  489. /// Gets or sets the album id.
  490. /// </summary>
  491. /// <value>The album id.</value>
  492. public string AlbumId { get; set; }
  493. /// <summary>
  494. /// Gets or sets the album image tag.
  495. /// </summary>
  496. /// <value>The album image tag.</value>
  497. public string AlbumPrimaryImageTag { get; set; }
  498. /// <summary>
  499. /// Gets or sets the series primary image tag.
  500. /// </summary>
  501. /// <value>The series primary image tag.</value>
  502. public string SeriesPrimaryImageTag { get; set; }
  503. /// <summary>
  504. /// Gets or sets the album artist.
  505. /// </summary>
  506. /// <value>The album artist.</value>
  507. public string AlbumArtist { get; set; }
  508. /// <summary>
  509. /// Gets or sets the album artists.
  510. /// </summary>
  511. /// <value>The album artists.</value>
  512. public List<NameIdPair> AlbumArtists { get; set; }
  513. /// <summary>
  514. /// Gets or sets the name of the season.
  515. /// </summary>
  516. /// <value>The name of the season.</value>
  517. public string SeasonName { get; set; }
  518. /// <summary>
  519. /// Gets or sets the media streams.
  520. /// </summary>
  521. /// <value>The media streams.</value>
  522. public List<MediaStream> MediaStreams { get; set; }
  523. /// <summary>
  524. /// Gets or sets the type of the video.
  525. /// </summary>
  526. /// <value>The type of the video.</value>
  527. public VideoType? VideoType { get; set; }
  528. /// <summary>
  529. /// Gets or sets the display type of the media.
  530. /// </summary>
  531. /// <value>The display type of the media.</value>
  532. public string DisplayMediaType { get; set; }
  533. /// <summary>
  534. /// Gets or sets the part count.
  535. /// </summary>
  536. /// <value>The part count.</value>
  537. public int? PartCount { get; set; }
  538. public int? MediaSourceCount { get; set; }
  539. /// <summary>
  540. /// Determines whether the specified type is type.
  541. /// </summary>
  542. /// <param name="type">The type.</param>
  543. /// <returns><c>true</c> if the specified type is type; otherwise, <c>false</c>.</returns>
  544. public bool IsType(Type type)
  545. {
  546. return IsType(type.Name);
  547. }
  548. /// <summary>
  549. /// Gets or sets a value indicating whether [supports playlists].
  550. /// </summary>
  551. /// <value><c>true</c> if [supports playlists]; otherwise, <c>false</c>.</value>
  552. public bool SupportsPlaylists
  553. {
  554. get
  555. {
  556. return RunTimeTicks.HasValue || IsFolder || IsGenre || IsMusicGenre || IsArtist;
  557. }
  558. }
  559. /// <summary>
  560. /// Determines whether the specified type is type.
  561. /// </summary>
  562. /// <param name="type">The type.</param>
  563. /// <returns><c>true</c> if the specified type is type; otherwise, <c>false</c>.</returns>
  564. public bool IsType(string type)
  565. {
  566. return StringHelper.EqualsIgnoreCase(Type, type);
  567. }
  568. /// <summary>
  569. /// Gets or sets the image tags.
  570. /// </summary>
  571. /// <value>The image tags.</value>
  572. public Dictionary<ImageType, string> ImageTags { get; set; }
  573. /// <summary>
  574. /// Gets or sets the backdrop image tags.
  575. /// </summary>
  576. /// <value>The backdrop image tags.</value>
  577. public List<string> BackdropImageTags { get; set; }
  578. /// <summary>
  579. /// Gets or sets the screenshot image tags.
  580. /// </summary>
  581. /// <value>The screenshot image tags.</value>
  582. public List<string> ScreenshotImageTags { get; set; }
  583. /// <summary>
  584. /// Gets or sets the parent logo image tag.
  585. /// </summary>
  586. /// <value>The parent logo image tag.</value>
  587. public string ParentLogoImageTag { get; set; }
  588. /// <summary>
  589. /// If the item does not have a art, this will hold the Id of the Parent that has one.
  590. /// </summary>
  591. /// <value>The parent art item id.</value>
  592. public string ParentArtItemId { get; set; }
  593. /// <summary>
  594. /// Gets or sets the parent art image tag.
  595. /// </summary>
  596. /// <value>The parent art image tag.</value>
  597. public string ParentArtImageTag { get; set; }
  598. /// <summary>
  599. /// Gets or sets the series thumb image tag.
  600. /// </summary>
  601. /// <value>The series thumb image tag.</value>
  602. public string SeriesThumbImageTag { get; set; }
  603. /// <summary>
  604. /// Gets or sets the series studio.
  605. /// </summary>
  606. /// <value>The series studio.</value>
  607. public string SeriesStudio { get; set; }
  608. /// <summary>
  609. /// Gets or sets the parent thumb item id.
  610. /// </summary>
  611. /// <value>The parent thumb item id.</value>
  612. public string ParentThumbItemId { get; set; }
  613. /// <summary>
  614. /// Gets or sets the parent thumb image tag.
  615. /// </summary>
  616. /// <value>The parent thumb image tag.</value>
  617. public string ParentThumbImageTag { get; set; }
  618. /// <summary>
  619. /// Gets or sets the parent primary image item identifier.
  620. /// </summary>
  621. /// <value>The parent primary image item identifier.</value>
  622. public string ParentPrimaryImageItemId { get; set; }
  623. /// <summary>
  624. /// Gets or sets the parent primary image tag.
  625. /// </summary>
  626. /// <value>The parent primary image tag.</value>
  627. public string ParentPrimaryImageTag { get; set; }
  628. /// <summary>
  629. /// Gets or sets the chapters.
  630. /// </summary>
  631. /// <value>The chapters.</value>
  632. public List<ChapterInfoDto> Chapters { get; set; }
  633. /// <summary>
  634. /// Gets or sets the type of the location.
  635. /// </summary>
  636. /// <value>The type of the location.</value>
  637. public LocationType LocationType { get; set; }
  638. /// <summary>
  639. /// Gets or sets the type of the iso.
  640. /// </summary>
  641. /// <value>The type of the iso.</value>
  642. public IsoType? IsoType { get; set; }
  643. /// <summary>
  644. /// Gets or sets the type of the media.
  645. /// </summary>
  646. /// <value>The type of the media.</value>
  647. public string MediaType { get; set; }
  648. /// <summary>
  649. /// Gets or sets the end date.
  650. /// </summary>
  651. /// <value>The end date.</value>
  652. public DateTime? EndDate { get; set; }
  653. /// <summary>
  654. /// Gets or sets the home page URL.
  655. /// </summary>
  656. /// <value>The home page URL.</value>
  657. public string HomePageUrl { get; set; }
  658. /// <summary>
  659. /// Gets or sets the production locations.
  660. /// </summary>
  661. /// <value>The production locations.</value>
  662. public List<string> ProductionLocations { get; set; }
  663. /// <summary>
  664. /// Gets or sets the budget.
  665. /// </summary>
  666. /// <value>The budget.</value>
  667. public double? Budget { get; set; }
  668. /// <summary>
  669. /// Gets or sets the revenue.
  670. /// </summary>
  671. /// <value>The revenue.</value>
  672. public double? Revenue { get; set; }
  673. /// <summary>
  674. /// Gets or sets the locked fields.
  675. /// </summary>
  676. /// <value>The locked fields.</value>
  677. public List<MetadataFields> LockedFields { get; set; }
  678. /// <summary>
  679. /// Gets or sets the movie count.
  680. /// </summary>
  681. /// <value>The movie count.</value>
  682. public int? MovieCount { get; set; }
  683. /// <summary>
  684. /// Gets or sets the series count.
  685. /// </summary>
  686. /// <value>The series count.</value>
  687. public int? SeriesCount { get; set; }
  688. /// <summary>
  689. /// Gets or sets the episode count.
  690. /// </summary>
  691. /// <value>The episode count.</value>
  692. public int? EpisodeCount { get; set; }
  693. /// <summary>
  694. /// Gets or sets the game count.
  695. /// </summary>
  696. /// <value>The game count.</value>
  697. public int? GameCount { get; set; }
  698. /// <summary>
  699. /// Gets or sets the song count.
  700. /// </summary>
  701. /// <value>The song count.</value>
  702. public int? SongCount { get; set; }
  703. /// <summary>
  704. /// Gets or sets the album count.
  705. /// </summary>
  706. /// <value>The album count.</value>
  707. public int? AlbumCount { get; set; }
  708. /// <summary>
  709. /// Gets or sets the music video count.
  710. /// </summary>
  711. /// <value>The music video count.</value>
  712. public int? MusicVideoCount { get; set; }
  713. /// <summary>
  714. /// Gets or sets a value indicating whether [enable internet providers].
  715. /// </summary>
  716. /// <value><c>true</c> if [enable internet providers]; otherwise, <c>false</c>.</value>
  717. public bool? LockData { get; set; }
  718. public int? Width { get; set; }
  719. public int? Height { get; set; }
  720. public string CameraMake { get; set; }
  721. public string CameraModel { get; set; }
  722. public string Software { get; set; }
  723. public double? ExposureTime { get; set; }
  724. public double? FocalLength { get; set; }
  725. public ImageOrientation? ImageOrientation { get; set; }
  726. public double? Aperture { get; set; }
  727. public double? ShutterSpeed { get; set; }
  728. public double? Latitude { get; set; }
  729. public double? Longitude { get; set; }
  730. public double? Altitude { get; set; }
  731. public int? IsoSpeedRating { get; set; }
  732. /// <summary>
  733. /// Used by RecordingGroup
  734. /// </summary>
  735. public int? RecordingCount { get; set; }
  736. /// <summary>
  737. /// Gets or sets the series timer identifier.
  738. /// </summary>
  739. /// <value>The series timer identifier.</value>
  740. public string SeriesTimerId { get; set; }
  741. /// <summary>
  742. /// Gets a value indicating whether this instance can resume.
  743. /// </summary>
  744. /// <value><c>true</c> if this instance can resume; otherwise, <c>false</c>.</value>
  745. [IgnoreDataMember]
  746. public bool CanResume
  747. {
  748. get { return UserData != null && UserData.PlaybackPositionTicks > 0; }
  749. }
  750. /// <summary>
  751. /// Gets the resume position ticks.
  752. /// </summary>
  753. /// <value>The resume position ticks.</value>
  754. [IgnoreDataMember]
  755. public long ResumePositionTicks
  756. {
  757. get { return UserData == null ? 0 : UserData.PlaybackPositionTicks; }
  758. }
  759. /// <summary>
  760. /// Gets the backdrop count.
  761. /// </summary>
  762. /// <value>The backdrop count.</value>
  763. [IgnoreDataMember]
  764. public int BackdropCount
  765. {
  766. get { return BackdropImageTags == null ? 0 : BackdropImageTags.Count; }
  767. }
  768. /// <summary>
  769. /// Gets the screenshot count.
  770. /// </summary>
  771. /// <value>The screenshot count.</value>
  772. [IgnoreDataMember]
  773. public int ScreenshotCount
  774. {
  775. get { return ScreenshotImageTags == null ? 0 : ScreenshotImageTags.Count; }
  776. }
  777. /// <summary>
  778. /// Gets a value indicating whether this instance has banner.
  779. /// </summary>
  780. /// <value><c>true</c> if this instance has banner; otherwise, <c>false</c>.</value>
  781. [IgnoreDataMember]
  782. public bool HasBanner
  783. {
  784. get { return ImageTags != null && ImageTags.ContainsKey(ImageType.Banner); }
  785. }
  786. /// <summary>
  787. /// Gets a value indicating whether this instance has art.
  788. /// </summary>
  789. /// <value><c>true</c> if this instance has art; otherwise, <c>false</c>.</value>
  790. [IgnoreDataMember]
  791. public bool HasArtImage
  792. {
  793. get { return ImageTags != null && ImageTags.ContainsKey(ImageType.Art); }
  794. }
  795. /// <summary>
  796. /// Gets a value indicating whether this instance has logo.
  797. /// </summary>
  798. /// <value><c>true</c> if this instance has logo; otherwise, <c>false</c>.</value>
  799. [IgnoreDataMember]
  800. public bool HasLogo
  801. {
  802. get { return ImageTags != null && ImageTags.ContainsKey(ImageType.Logo); }
  803. }
  804. /// <summary>
  805. /// Gets a value indicating whether this instance has thumb.
  806. /// </summary>
  807. /// <value><c>true</c> if this instance has thumb; otherwise, <c>false</c>.</value>
  808. [IgnoreDataMember]
  809. public bool HasThumb
  810. {
  811. get { return ImageTags != null && ImageTags.ContainsKey(ImageType.Thumb); }
  812. }
  813. /// <summary>
  814. /// Gets a value indicating whether this instance has primary image.
  815. /// </summary>
  816. /// <value><c>true</c> if this instance has primary image; otherwise, <c>false</c>.</value>
  817. [IgnoreDataMember]
  818. public bool HasPrimaryImage
  819. {
  820. get { return ImageTags != null && ImageTags.ContainsKey(ImageType.Primary); }
  821. }
  822. /// <summary>
  823. /// Gets a value indicating whether this instance has disc image.
  824. /// </summary>
  825. /// <value><c>true</c> if this instance has disc image; otherwise, <c>false</c>.</value>
  826. [IgnoreDataMember]
  827. public bool HasDiscImage
  828. {
  829. get { return ImageTags != null && ImageTags.ContainsKey(ImageType.Disc); }
  830. }
  831. /// <summary>
  832. /// Gets a value indicating whether this instance has box image.
  833. /// </summary>
  834. /// <value><c>true</c> if this instance has box image; otherwise, <c>false</c>.</value>
  835. [IgnoreDataMember]
  836. public bool HasBoxImage
  837. {
  838. get { return ImageTags != null && ImageTags.ContainsKey(ImageType.Box); }
  839. }
  840. /// <summary>
  841. /// Gets a value indicating whether this instance has box image.
  842. /// </summary>
  843. /// <value><c>true</c> if this instance has box image; otherwise, <c>false</c>.</value>
  844. [IgnoreDataMember]
  845. public bool HasBoxRearImage
  846. {
  847. get { return ImageTags != null && ImageTags.ContainsKey(ImageType.BoxRear); }
  848. }
  849. /// <summary>
  850. /// Gets a value indicating whether this instance has menu image.
  851. /// </summary>
  852. /// <value><c>true</c> if this instance has menu image; otherwise, <c>false</c>.</value>
  853. [IgnoreDataMember]
  854. public bool HasMenuImage
  855. {
  856. get { return ImageTags != null && ImageTags.ContainsKey(ImageType.Menu); }
  857. }
  858. /// <summary>
  859. /// Gets a value indicating whether this instance is video.
  860. /// </summary>
  861. /// <value><c>true</c> if this instance is video; otherwise, <c>false</c>.</value>
  862. [IgnoreDataMember]
  863. public bool IsVideo
  864. {
  865. get { return StringHelper.EqualsIgnoreCase(MediaType, Entities.MediaType.Video); }
  866. }
  867. /// <summary>
  868. /// Gets a value indicating whether this instance is audio.
  869. /// </summary>
  870. /// <value><c>true</c> if this instance is audio; otherwise, <c>false</c>.</value>
  871. [IgnoreDataMember]
  872. public bool IsAudio
  873. {
  874. get { return StringHelper.EqualsIgnoreCase(MediaType, Entities.MediaType.Audio); }
  875. }
  876. /// <summary>
  877. /// Gets a value indicating whether this instance is game.
  878. /// </summary>
  879. /// <value><c>true</c> if this instance is game; otherwise, <c>false</c>.</value>
  880. [IgnoreDataMember]
  881. public bool IsGame
  882. {
  883. get { return StringHelper.EqualsIgnoreCase(MediaType, Entities.MediaType.Game); }
  884. }
  885. /// <summary>
  886. /// Gets a value indicating whether this instance is person.
  887. /// </summary>
  888. /// <value><c>true</c> if this instance is person; otherwise, <c>false</c>.</value>
  889. [IgnoreDataMember]
  890. public bool IsPerson
  891. {
  892. get { return StringHelper.EqualsIgnoreCase(Type, "Person"); }
  893. }
  894. /// <summary>
  895. /// Gets a value indicating whether this instance is root.
  896. /// </summary>
  897. /// <value><c>true</c> if this instance is root; otherwise, <c>false</c>.</value>
  898. [IgnoreDataMember]
  899. public bool IsRoot
  900. {
  901. get { return StringHelper.EqualsIgnoreCase(Type, "AggregateFolder"); }
  902. }
  903. [IgnoreDataMember]
  904. public bool IsMusicGenre
  905. {
  906. get { return StringHelper.EqualsIgnoreCase(Type, "MusicGenre"); }
  907. }
  908. [IgnoreDataMember]
  909. public bool IsGameGenre
  910. {
  911. get { return StringHelper.EqualsIgnoreCase(Type, "GameGenre"); }
  912. }
  913. [IgnoreDataMember]
  914. public bool IsGenre
  915. {
  916. get { return StringHelper.EqualsIgnoreCase(Type, "Genre"); }
  917. }
  918. [IgnoreDataMember]
  919. public bool IsArtist
  920. {
  921. get { return StringHelper.EqualsIgnoreCase(Type, "MusicArtist"); }
  922. }
  923. [IgnoreDataMember]
  924. public bool IsAlbum
  925. {
  926. get { return StringHelper.EqualsIgnoreCase(Type, "MusicAlbum"); }
  927. }
  928. [IgnoreDataMember]
  929. public bool IsStudio
  930. {
  931. get { return StringHelper.EqualsIgnoreCase(Type, "Studio"); }
  932. }
  933. /// <summary>
  934. /// Occurs when [property changed].
  935. /// </summary>
  936. public event PropertyChangedEventHandler PropertyChanged;
  937. /// <summary>
  938. /// Gets or sets the program identifier.
  939. /// </summary>
  940. /// <value>The program identifier.</value>
  941. public string ProgramId { get; set; }
  942. /// <summary>
  943. /// Gets or sets the channel primary image tag.
  944. /// </summary>
  945. /// <value>The channel primary image tag.</value>
  946. public string ChannelPrimaryImageTag { get; set; }
  947. /// <summary>
  948. /// The start date of the recording, in UTC.
  949. /// </summary>
  950. public DateTime? StartDate { get; set; }
  951. /// <summary>
  952. /// Gets or sets the original air date.
  953. /// </summary>
  954. /// <value>The original air date.</value>
  955. public DateTime? OriginalAirDate { get; set; }
  956. /// <summary>
  957. /// Gets or sets the completion percentage.
  958. /// </summary>
  959. /// <value>The completion percentage.</value>
  960. public double? CompletionPercentage { get; set; }
  961. /// <summary>
  962. /// Gets or sets a value indicating whether this instance is repeat.
  963. /// </summary>
  964. /// <value><c>true</c> if this instance is repeat; otherwise, <c>false</c>.</value>
  965. public bool? IsRepeat { get; set; }
  966. /// <summary>
  967. /// Gets or sets the episode title.
  968. /// </summary>
  969. /// <value>The episode title.</value>
  970. public string EpisodeTitle { get; set; }
  971. /// <summary>
  972. /// Gets or sets the type of the channel.
  973. /// </summary>
  974. /// <value>The type of the channel.</value>
  975. public ChannelType? ChannelType { get; set; }
  976. /// <summary>
  977. /// Gets or sets the audio.
  978. /// </summary>
  979. /// <value>The audio.</value>
  980. public ProgramAudio? Audio { get; set; }
  981. /// <summary>
  982. /// Gets or sets a value indicating whether this instance is movie.
  983. /// </summary>
  984. /// <value><c>true</c> if this instance is movie; otherwise, <c>false</c>.</value>
  985. public bool? IsMovie { get; set; }
  986. /// <summary>
  987. /// Gets or sets a value indicating whether this instance is sports.
  988. /// </summary>
  989. /// <value><c>true</c> if this instance is sports; otherwise, <c>false</c>.</value>
  990. public bool? IsSports { get; set; }
  991. /// <summary>
  992. /// Gets or sets a value indicating whether this instance is series.
  993. /// </summary>
  994. /// <value><c>true</c> if this instance is series; otherwise, <c>false</c>.</value>
  995. public bool? IsSeries { get; set; }
  996. /// <summary>
  997. /// Gets or sets a value indicating whether this instance is live.
  998. /// </summary>
  999. /// <value><c>true</c> if this instance is live; otherwise, <c>false</c>.</value>
  1000. public bool? IsLive { get; set; }
  1001. /// <summary>
  1002. /// Gets or sets a value indicating whether this instance is news.
  1003. /// </summary>
  1004. /// <value><c>true</c> if this instance is news; otherwise, <c>false</c>.</value>
  1005. public bool? IsNews { get; set; }
  1006. /// <summary>
  1007. /// Gets or sets a value indicating whether this instance is kids.
  1008. /// </summary>
  1009. /// <value><c>true</c> if this instance is kids; otherwise, <c>false</c>.</value>
  1010. public bool? IsKids { get; set; }
  1011. /// <summary>
  1012. /// Gets or sets a value indicating whether this instance is premiere.
  1013. /// </summary>
  1014. /// <value><c>true</c> if this instance is premiere; otherwise, <c>false</c>.</value>
  1015. public bool? IsPremiere { get; set; }
  1016. /// <summary>
  1017. /// Gets or sets the timer identifier.
  1018. /// </summary>
  1019. /// <value>The timer identifier.</value>
  1020. public string TimerId { get; set; }
  1021. }
  1022. }