BaseItemDto.cs 40 KB

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