BaseItemDto.cs 40 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192
  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 bool? HasSubtitles { get; set; }
  62. public string PreferredMetadataLanguage { get; set; }
  63. public string PreferredMetadataCountryCode { get; set; }
  64. public string AwardSummary { get; set; }
  65. public string ShareUrl { get; set; }
  66. public float? Metascore { 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 players supported by a game.
  239. /// </summary>
  240. /// <value>The players.</value>
  241. public int? Players { get; set; }
  242. /// <summary>
  243. /// Gets or sets a value indicating whether this instance is place holder.
  244. /// </summary>
  245. /// <value><c>null</c> if [is place holder] contains no value, <c>true</c> if [is place holder]; otherwise, <c>false</c>.</value>
  246. public bool? IsPlaceHolder { get; set; }
  247. /// <summary>
  248. /// Gets or sets the index number.
  249. /// </summary>
  250. /// <value>The index number.</value>
  251. public int? IndexNumber { get; set; }
  252. /// <summary>
  253. /// Gets or sets the index number end.
  254. /// </summary>
  255. /// <value>The index number end.</value>
  256. public int? IndexNumberEnd { get; set; }
  257. /// <summary>
  258. /// Gets or sets the parent index number.
  259. /// </summary>
  260. /// <value>The parent index number.</value>
  261. public int? ParentIndexNumber { get; set; }
  262. /// <summary>
  263. /// Gets or sets the trailer urls.
  264. /// </summary>
  265. /// <value>The trailer urls.</value>
  266. public List<MediaUrl> RemoteTrailers { get; set; }
  267. /// <summary>
  268. /// Gets or sets the soundtrack ids.
  269. /// </summary>
  270. /// <value>The soundtrack ids.</value>
  271. public string[] SoundtrackIds { get; set; }
  272. /// <summary>
  273. /// Gets or sets the provider ids.
  274. /// </summary>
  275. /// <value>The provider ids.</value>
  276. public Dictionary<string, string> ProviderIds { get; set; }
  277. /// <summary>
  278. /// Gets or sets a value indicating whether this instance is HD.
  279. /// </summary>
  280. /// <value><c>null</c> if [is HD] contains no value, <c>true</c> if [is HD]; otherwise, <c>false</c>.</value>
  281. public bool? IsHD { get; set; }
  282. /// <summary>
  283. /// Gets or sets a value indicating whether this instance is folder.
  284. /// </summary>
  285. /// <value><c>true</c> if this instance is folder; otherwise, <c>false</c>.</value>
  286. public bool IsFolder { get; set; }
  287. /// <summary>
  288. /// Gets or sets the parent id.
  289. /// </summary>
  290. /// <value>The parent id.</value>
  291. public string ParentId { get; set; }
  292. /// <summary>
  293. /// Gets or sets the type.
  294. /// </summary>
  295. /// <value>The type.</value>
  296. public string Type { get; set; }
  297. /// <summary>
  298. /// Gets or sets the people.
  299. /// </summary>
  300. /// <value>The people.</value>
  301. public BaseItemPerson[] People { get; set; }
  302. /// <summary>
  303. /// Gets or sets the studios.
  304. /// </summary>
  305. /// <value>The studios.</value>
  306. public StudioDto[] Studios { get; set; }
  307. /// <summary>
  308. /// If the item does not have a logo, this will hold the Id of the Parent that has one.
  309. /// </summary>
  310. /// <value>The parent logo item id.</value>
  311. public string ParentLogoItemId { get; set; }
  312. /// <summary>
  313. /// If the item does not have any backdrops, this will hold the Id of the Parent that has one.
  314. /// </summary>
  315. /// <value>The parent backdrop item id.</value>
  316. public string ParentBackdropItemId { get; set; }
  317. /// <summary>
  318. /// Gets or sets the parent backdrop image tags.
  319. /// </summary>
  320. /// <value>The parent backdrop image tags.</value>
  321. public List<string> ParentBackdropImageTags { get; set; }
  322. /// <summary>
  323. /// Gets or sets the local trailer count.
  324. /// </summary>
  325. /// <value>The local trailer count.</value>
  326. public int? LocalTrailerCount { get; set; }
  327. /// <summary>
  328. /// User data for this item based on the user it's being requested for
  329. /// </summary>
  330. /// <value>The user data.</value>
  331. public UserItemDataDto UserData { get; set; }
  332. /// <summary>
  333. /// Gets or sets the season user data.
  334. /// </summary>
  335. /// <value>The season user data.</value>
  336. public UserItemDataDto SeasonUserData { get; set; }
  337. /// <summary>
  338. /// Gets or sets the recursive item count.
  339. /// </summary>
  340. /// <value>The recursive item count.</value>
  341. public int? RecursiveItemCount { get; set; }
  342. /// <summary>
  343. /// Gets or sets the child count.
  344. /// </summary>
  345. /// <value>The child count.</value>
  346. public int? ChildCount { get; set; }
  347. /// <summary>
  348. /// Gets or sets the name of the series.
  349. /// </summary>
  350. /// <value>The name of the series.</value>
  351. public string SeriesName { get; set; }
  352. /// <summary>
  353. /// Gets or sets the series id.
  354. /// </summary>
  355. /// <value>The series id.</value>
  356. public string SeriesId { get; set; }
  357. /// <summary>
  358. /// Gets or sets the season identifier.
  359. /// </summary>
  360. /// <value>The season identifier.</value>
  361. public string SeasonId { get; set; }
  362. /// <summary>
  363. /// Gets or sets the special feature count.
  364. /// </summary>
  365. /// <value>The special feature count.</value>
  366. public int? SpecialFeatureCount { get; set; }
  367. /// <summary>
  368. /// Gets or sets the display preferences id.
  369. /// </summary>
  370. /// <value>The display preferences id.</value>
  371. public string DisplayPreferencesId { get; set; }
  372. /// <summary>
  373. /// Gets or sets the status.
  374. /// </summary>
  375. /// <value>The status.</value>
  376. public string Status { get; set; }
  377. [IgnoreDataMember]
  378. public SeriesStatus? SeriesStatus
  379. {
  380. get
  381. {
  382. if (string.IsNullOrEmpty(Status))
  383. {
  384. return null;
  385. }
  386. return (SeriesStatus)Enum.Parse(typeof(SeriesStatus), Status, true);
  387. }
  388. set
  389. {
  390. if (value == null)
  391. {
  392. Status = null;
  393. }
  394. else
  395. {
  396. Status = value.Value.ToString();
  397. }
  398. }
  399. }
  400. [IgnoreDataMember]
  401. public RecordingStatus? RecordingStatus
  402. {
  403. get
  404. {
  405. if (string.IsNullOrEmpty(Status))
  406. {
  407. return null;
  408. }
  409. return (RecordingStatus)Enum.Parse(typeof(RecordingStatus), Status, true);
  410. }
  411. set
  412. {
  413. if (value == null)
  414. {
  415. Status = null;
  416. }
  417. else
  418. {
  419. Status = value.Value.ToString();
  420. }
  421. }
  422. }
  423. /// <summary>
  424. /// Gets or sets the air time.
  425. /// </summary>
  426. /// <value>The air time.</value>
  427. public string AirTime { get; set; }
  428. /// <summary>
  429. /// Gets or sets the air days.
  430. /// </summary>
  431. /// <value>The air days.</value>
  432. public List<DayOfWeek> AirDays { get; set; }
  433. /// <summary>
  434. /// Gets or sets the index options.
  435. /// </summary>
  436. /// <value>The index options.</value>
  437. public string[] IndexOptions { get; set; }
  438. /// <summary>
  439. /// Gets or sets the tags.
  440. /// </summary>
  441. /// <value>The tags.</value>
  442. public List<string> Tags { get; set; }
  443. /// <summary>
  444. /// Gets or sets the keywords.
  445. /// </summary>
  446. /// <value>The keywords.</value>
  447. public List<string> Keywords { get; set; }
  448. /// <summary>
  449. /// Gets or sets the primary image aspect ratio, after image enhancements.
  450. /// </summary>
  451. /// <value>The primary image aspect ratio.</value>
  452. public double? PrimaryImageAspectRatio { get; set; }
  453. /// <summary>
  454. /// Gets or sets the artists.
  455. /// </summary>
  456. /// <value>The artists.</value>
  457. public List<string> Artists { get; set; }
  458. /// <summary>
  459. /// Gets or sets the artist items.
  460. /// </summary>
  461. /// <value>The artist items.</value>
  462. public List<NameIdPair> ArtistItems { get; set; }
  463. /// <summary>
  464. /// Gets or sets the album.
  465. /// </summary>
  466. /// <value>The album.</value>
  467. public string Album { get; set; }
  468. /// <summary>
  469. /// Gets or sets the type of the collection.
  470. /// </summary>
  471. /// <value>The type of the collection.</value>
  472. public string CollectionType { get; set; }
  473. /// <summary>
  474. /// Gets or sets the type of the original collection.
  475. /// </summary>
  476. /// <value>The type of the original collection.</value>
  477. public string OriginalCollectionType { get; set; }
  478. /// <summary>
  479. /// Gets or sets the display order.
  480. /// </summary>
  481. /// <value>The display order.</value>
  482. public string DisplayOrder { get; set; }
  483. /// <summary>
  484. /// Gets or sets the album id.
  485. /// </summary>
  486. /// <value>The album id.</value>
  487. public string AlbumId { get; set; }
  488. /// <summary>
  489. /// Gets or sets the album image tag.
  490. /// </summary>
  491. /// <value>The album image tag.</value>
  492. public string AlbumPrimaryImageTag { get; set; }
  493. /// <summary>
  494. /// Gets or sets the series primary image tag.
  495. /// </summary>
  496. /// <value>The series primary image tag.</value>
  497. public string SeriesPrimaryImageTag { get; set; }
  498. /// <summary>
  499. /// Gets or sets the album artist.
  500. /// </summary>
  501. /// <value>The album artist.</value>
  502. public string AlbumArtist { get; set; }
  503. /// <summary>
  504. /// Gets or sets the album artists.
  505. /// </summary>
  506. /// <value>The album artists.</value>
  507. public List<NameIdPair> AlbumArtists { get; set; }
  508. /// <summary>
  509. /// Gets or sets the name of the season.
  510. /// </summary>
  511. /// <value>The name of the season.</value>
  512. public string SeasonName { get; set; }
  513. /// <summary>
  514. /// Gets or sets the media streams.
  515. /// </summary>
  516. /// <value>The media streams.</value>
  517. public List<MediaStream> MediaStreams { get; set; }
  518. /// <summary>
  519. /// Gets or sets the type of the video.
  520. /// </summary>
  521. /// <value>The type of the video.</value>
  522. public VideoType? VideoType { get; set; }
  523. /// <summary>
  524. /// Gets or sets the display type of the media.
  525. /// </summary>
  526. /// <value>The display type of the media.</value>
  527. public string DisplayMediaType { get; set; }
  528. /// <summary>
  529. /// Gets or sets the part count.
  530. /// </summary>
  531. /// <value>The part count.</value>
  532. public int? PartCount { get; set; }
  533. public int? MediaSourceCount { get; set; }
  534. /// <summary>
  535. /// Determines whether the specified type is type.
  536. /// </summary>
  537. /// <param name="type">The type.</param>
  538. /// <returns><c>true</c> if the specified type is type; otherwise, <c>false</c>.</returns>
  539. public bool IsType(Type type)
  540. {
  541. return IsType(type.Name);
  542. }
  543. /// <summary>
  544. /// Gets or sets a value indicating whether [supports playlists].
  545. /// </summary>
  546. /// <value><c>true</c> if [supports playlists]; otherwise, <c>false</c>.</value>
  547. [IgnoreDataMember]
  548. public bool SupportsPlaylists
  549. {
  550. get
  551. {
  552. return RunTimeTicks.HasValue || IsFolder || IsGenre || IsMusicGenre || IsArtist;
  553. }
  554. }
  555. /// <summary>
  556. /// Determines whether the specified type is type.
  557. /// </summary>
  558. /// <param name="type">The type.</param>
  559. /// <returns><c>true</c> if the specified type is type; otherwise, <c>false</c>.</returns>
  560. public bool IsType(string type)
  561. {
  562. return StringHelper.EqualsIgnoreCase(Type, type);
  563. }
  564. /// <summary>
  565. /// Gets or sets the image tags.
  566. /// </summary>
  567. /// <value>The image tags.</value>
  568. public Dictionary<ImageType, string> ImageTags { get; set; }
  569. /// <summary>
  570. /// Gets or sets the backdrop image tags.
  571. /// </summary>
  572. /// <value>The backdrop image tags.</value>
  573. public List<string> BackdropImageTags { get; set; }
  574. /// <summary>
  575. /// Gets or sets the screenshot image tags.
  576. /// </summary>
  577. /// <value>The screenshot image tags.</value>
  578. public List<string> ScreenshotImageTags { get; set; }
  579. /// <summary>
  580. /// Gets or sets the parent logo image tag.
  581. /// </summary>
  582. /// <value>The parent logo image tag.</value>
  583. public string ParentLogoImageTag { get; set; }
  584. /// <summary>
  585. /// If the item does not have a art, this will hold the Id of the Parent that has one.
  586. /// </summary>
  587. /// <value>The parent art item id.</value>
  588. public string ParentArtItemId { get; set; }
  589. /// <summary>
  590. /// Gets or sets the parent art image tag.
  591. /// </summary>
  592. /// <value>The parent art image tag.</value>
  593. public string ParentArtImageTag { get; set; }
  594. /// <summary>
  595. /// Gets or sets the series thumb image tag.
  596. /// </summary>
  597. /// <value>The series thumb image tag.</value>
  598. public string SeriesThumbImageTag { get; set; }
  599. /// <summary>
  600. /// Gets or sets the series studio.
  601. /// </summary>
  602. /// <value>The series studio.</value>
  603. public string SeriesStudio { get; set; }
  604. /// <summary>
  605. /// Gets or sets the parent thumb item id.
  606. /// </summary>
  607. /// <value>The parent thumb item id.</value>
  608. public string ParentThumbItemId { get; set; }
  609. /// <summary>
  610. /// Gets or sets the parent thumb image tag.
  611. /// </summary>
  612. /// <value>The parent thumb image tag.</value>
  613. public string ParentThumbImageTag { get; set; }
  614. /// <summary>
  615. /// Gets or sets the parent primary image item identifier.
  616. /// </summary>
  617. /// <value>The parent primary image item identifier.</value>
  618. public string ParentPrimaryImageItemId { get; set; }
  619. /// <summary>
  620. /// Gets or sets the parent primary image tag.
  621. /// </summary>
  622. /// <value>The parent primary image tag.</value>
  623. public string ParentPrimaryImageTag { get; set; }
  624. /// <summary>
  625. /// Gets or sets the chapters.
  626. /// </summary>
  627. /// <value>The chapters.</value>
  628. public List<ChapterInfoDto> Chapters { get; set; }
  629. /// <summary>
  630. /// Gets or sets the type of the location.
  631. /// </summary>
  632. /// <value>The type of the location.</value>
  633. public LocationType LocationType { get; set; }
  634. /// <summary>
  635. /// Gets or sets the type of the iso.
  636. /// </summary>
  637. /// <value>The type of the iso.</value>
  638. public IsoType? IsoType { get; set; }
  639. /// <summary>
  640. /// Gets or sets the type of the media.
  641. /// </summary>
  642. /// <value>The type of the media.</value>
  643. public string MediaType { get; set; }
  644. /// <summary>
  645. /// Gets or sets the end date.
  646. /// </summary>
  647. /// <value>The end date.</value>
  648. public DateTime? EndDate { get; set; }
  649. /// <summary>
  650. /// Gets or sets the home page URL.
  651. /// </summary>
  652. /// <value>The home page URL.</value>
  653. public string HomePageUrl { get; set; }
  654. /// <summary>
  655. /// Gets or sets the production locations.
  656. /// </summary>
  657. /// <value>The production locations.</value>
  658. public List<string> ProductionLocations { get; set; }
  659. /// <summary>
  660. /// Gets or sets the budget.
  661. /// </summary>
  662. /// <value>The budget.</value>
  663. public double? Budget { get; set; }
  664. /// <summary>
  665. /// Gets or sets the revenue.
  666. /// </summary>
  667. /// <value>The revenue.</value>
  668. public double? Revenue { get; set; }
  669. /// <summary>
  670. /// Gets or sets the locked fields.
  671. /// </summary>
  672. /// <value>The locked fields.</value>
  673. public List<MetadataFields> LockedFields { get; set; }
  674. /// <summary>
  675. /// Gets or sets the movie count.
  676. /// </summary>
  677. /// <value>The movie count.</value>
  678. public int? MovieCount { get; set; }
  679. /// <summary>
  680. /// Gets or sets the series count.
  681. /// </summary>
  682. /// <value>The series count.</value>
  683. public int? SeriesCount { get; set; }
  684. /// <summary>
  685. /// Gets or sets the episode count.
  686. /// </summary>
  687. /// <value>The episode count.</value>
  688. public int? EpisodeCount { get; set; }
  689. /// <summary>
  690. /// Gets or sets the game count.
  691. /// </summary>
  692. /// <value>The game count.</value>
  693. public int? GameCount { get; set; }
  694. /// <summary>
  695. /// Gets or sets the song count.
  696. /// </summary>
  697. /// <value>The song count.</value>
  698. public int? SongCount { get; set; }
  699. /// <summary>
  700. /// Gets or sets the album count.
  701. /// </summary>
  702. /// <value>The album count.</value>
  703. public int? AlbumCount { get; set; }
  704. /// <summary>
  705. /// Gets or sets the music video count.
  706. /// </summary>
  707. /// <value>The music video count.</value>
  708. public int? MusicVideoCount { get; set; }
  709. /// <summary>
  710. /// Gets or sets a value indicating whether [enable internet providers].
  711. /// </summary>
  712. /// <value><c>true</c> if [enable internet providers]; otherwise, <c>false</c>.</value>
  713. public bool? LockData { get; set; }
  714. public int? Width { get; set; }
  715. public int? Height { get; set; }
  716. public string CameraMake { get; set; }
  717. public string CameraModel { get; set; }
  718. public string Software { get; set; }
  719. public double? ExposureTime { get; set; }
  720. public double? FocalLength { get; set; }
  721. public ImageOrientation? ImageOrientation { get; set; }
  722. public double? Aperture { get; set; }
  723. public double? ShutterSpeed { get; set; }
  724. public double? Latitude { get; set; }
  725. public double? Longitude { get; set; }
  726. public double? Altitude { get; set; }
  727. public int? IsoSpeedRating { get; set; }
  728. /// <summary>
  729. /// Used by RecordingGroup
  730. /// </summary>
  731. public int? RecordingCount { get; set; }
  732. /// <summary>
  733. /// Gets or sets the series timer identifier.
  734. /// </summary>
  735. /// <value>The series timer identifier.</value>
  736. public string SeriesTimerId { get; set; }
  737. /// <summary>
  738. /// Gets a value indicating whether this instance can resume.
  739. /// </summary>
  740. /// <value><c>true</c> if this instance can resume; otherwise, <c>false</c>.</value>
  741. [IgnoreDataMember]
  742. public bool CanResume
  743. {
  744. get { return UserData != null && UserData.PlaybackPositionTicks > 0; }
  745. }
  746. /// <summary>
  747. /// Gets the resume position ticks.
  748. /// </summary>
  749. /// <value>The resume position ticks.</value>
  750. [IgnoreDataMember]
  751. public long ResumePositionTicks
  752. {
  753. get { return UserData == null ? 0 : UserData.PlaybackPositionTicks; }
  754. }
  755. /// <summary>
  756. /// Gets the backdrop count.
  757. /// </summary>
  758. /// <value>The backdrop count.</value>
  759. [IgnoreDataMember]
  760. public int BackdropCount
  761. {
  762. get { return BackdropImageTags == null ? 0 : BackdropImageTags.Count; }
  763. }
  764. /// <summary>
  765. /// Gets the screenshot count.
  766. /// </summary>
  767. /// <value>The screenshot count.</value>
  768. [IgnoreDataMember]
  769. public int ScreenshotCount
  770. {
  771. get { return ScreenshotImageTags == null ? 0 : ScreenshotImageTags.Count; }
  772. }
  773. /// <summary>
  774. /// Gets a value indicating whether this instance has banner.
  775. /// </summary>
  776. /// <value><c>true</c> if this instance has banner; otherwise, <c>false</c>.</value>
  777. [IgnoreDataMember]
  778. public bool HasBanner
  779. {
  780. get { return ImageTags != null && ImageTags.ContainsKey(ImageType.Banner); }
  781. }
  782. /// <summary>
  783. /// Gets a value indicating whether this instance has art.
  784. /// </summary>
  785. /// <value><c>true</c> if this instance has art; otherwise, <c>false</c>.</value>
  786. [IgnoreDataMember]
  787. public bool HasArtImage
  788. {
  789. get { return ImageTags != null && ImageTags.ContainsKey(ImageType.Art); }
  790. }
  791. /// <summary>
  792. /// Gets a value indicating whether this instance has logo.
  793. /// </summary>
  794. /// <value><c>true</c> if this instance has logo; otherwise, <c>false</c>.</value>
  795. [IgnoreDataMember]
  796. public bool HasLogo
  797. {
  798. get { return ImageTags != null && ImageTags.ContainsKey(ImageType.Logo); }
  799. }
  800. /// <summary>
  801. /// Gets a value indicating whether this instance has thumb.
  802. /// </summary>
  803. /// <value><c>true</c> if this instance has thumb; otherwise, <c>false</c>.</value>
  804. [IgnoreDataMember]
  805. public bool HasThumb
  806. {
  807. get { return ImageTags != null && ImageTags.ContainsKey(ImageType.Thumb); }
  808. }
  809. /// <summary>
  810. /// Gets a value indicating whether this instance has primary image.
  811. /// </summary>
  812. /// <value><c>true</c> if this instance has primary image; otherwise, <c>false</c>.</value>
  813. [IgnoreDataMember]
  814. public bool HasPrimaryImage
  815. {
  816. get { return ImageTags != null && ImageTags.ContainsKey(ImageType.Primary); }
  817. }
  818. /// <summary>
  819. /// Gets a value indicating whether this instance has disc image.
  820. /// </summary>
  821. /// <value><c>true</c> if this instance has disc image; otherwise, <c>false</c>.</value>
  822. [IgnoreDataMember]
  823. public bool HasDiscImage
  824. {
  825. get { return ImageTags != null && ImageTags.ContainsKey(ImageType.Disc); }
  826. }
  827. /// <summary>
  828. /// Gets a value indicating whether this instance has box image.
  829. /// </summary>
  830. /// <value><c>true</c> if this instance has box image; otherwise, <c>false</c>.</value>
  831. [IgnoreDataMember]
  832. public bool HasBoxImage
  833. {
  834. get { return ImageTags != null && ImageTags.ContainsKey(ImageType.Box); }
  835. }
  836. /// <summary>
  837. /// Gets a value indicating whether this instance has box image.
  838. /// </summary>
  839. /// <value><c>true</c> if this instance has box image; otherwise, <c>false</c>.</value>
  840. [IgnoreDataMember]
  841. public bool HasBoxRearImage
  842. {
  843. get { return ImageTags != null && ImageTags.ContainsKey(ImageType.BoxRear); }
  844. }
  845. /// <summary>
  846. /// Gets a value indicating whether this instance has menu image.
  847. /// </summary>
  848. /// <value><c>true</c> if this instance has menu image; otherwise, <c>false</c>.</value>
  849. [IgnoreDataMember]
  850. public bool HasMenuImage
  851. {
  852. get { return ImageTags != null && ImageTags.ContainsKey(ImageType.Menu); }
  853. }
  854. /// <summary>
  855. /// Gets a value indicating whether this instance is video.
  856. /// </summary>
  857. /// <value><c>true</c> if this instance is video; otherwise, <c>false</c>.</value>
  858. [IgnoreDataMember]
  859. public bool IsVideo
  860. {
  861. get { return StringHelper.EqualsIgnoreCase(MediaType, Entities.MediaType.Video); }
  862. }
  863. /// <summary>
  864. /// Gets a value indicating whether this instance is audio.
  865. /// </summary>
  866. /// <value><c>true</c> if this instance is audio; otherwise, <c>false</c>.</value>
  867. [IgnoreDataMember]
  868. public bool IsAudio
  869. {
  870. get { return StringHelper.EqualsIgnoreCase(MediaType, Entities.MediaType.Audio); }
  871. }
  872. /// <summary>
  873. /// Gets a value indicating whether this instance is game.
  874. /// </summary>
  875. /// <value><c>true</c> if this instance is game; otherwise, <c>false</c>.</value>
  876. [IgnoreDataMember]
  877. public bool IsGame
  878. {
  879. get { return StringHelper.EqualsIgnoreCase(MediaType, Entities.MediaType.Game); }
  880. }
  881. /// <summary>
  882. /// Gets a value indicating whether this instance is person.
  883. /// </summary>
  884. /// <value><c>true</c> if this instance is person; otherwise, <c>false</c>.</value>
  885. [IgnoreDataMember]
  886. public bool IsPerson
  887. {
  888. get { return StringHelper.EqualsIgnoreCase(Type, "Person"); }
  889. }
  890. /// <summary>
  891. /// Gets a value indicating whether this instance is root.
  892. /// </summary>
  893. /// <value><c>true</c> if this instance is root; otherwise, <c>false</c>.</value>
  894. [IgnoreDataMember]
  895. public bool IsRoot
  896. {
  897. get { return StringHelper.EqualsIgnoreCase(Type, "AggregateFolder"); }
  898. }
  899. [IgnoreDataMember]
  900. public bool IsMusicGenre
  901. {
  902. get { return StringHelper.EqualsIgnoreCase(Type, "MusicGenre"); }
  903. }
  904. [IgnoreDataMember]
  905. public bool IsGameGenre
  906. {
  907. get { return StringHelper.EqualsIgnoreCase(Type, "GameGenre"); }
  908. }
  909. [IgnoreDataMember]
  910. public bool IsGenre
  911. {
  912. get { return StringHelper.EqualsIgnoreCase(Type, "Genre"); }
  913. }
  914. [IgnoreDataMember]
  915. public bool IsArtist
  916. {
  917. get { return StringHelper.EqualsIgnoreCase(Type, "MusicArtist"); }
  918. }
  919. [IgnoreDataMember]
  920. public bool IsAlbum
  921. {
  922. get { return StringHelper.EqualsIgnoreCase(Type, "MusicAlbum"); }
  923. }
  924. [IgnoreDataMember]
  925. public bool IsStudio
  926. {
  927. get { return StringHelper.EqualsIgnoreCase(Type, "Studio"); }
  928. }
  929. [IgnoreDataMember]
  930. public bool SupportsSimilarItems
  931. {
  932. get
  933. {
  934. return IsType("Movie") || IsType("Series") || IsType("MusicAlbum") || IsType("MusicArtist") || IsType("Program") || IsType("Recording") || IsType("ChannelVideoItem") || IsType("Game");
  935. }
  936. }
  937. /// <summary>
  938. /// Occurs when [property changed].
  939. /// </summary>
  940. public event PropertyChangedEventHandler PropertyChanged;
  941. /// <summary>
  942. /// Gets or sets the program identifier.
  943. /// </summary>
  944. /// <value>The program identifier.</value>
  945. public string ProgramId { get; set; }
  946. /// <summary>
  947. /// Gets or sets the channel primary image tag.
  948. /// </summary>
  949. /// <value>The channel primary image tag.</value>
  950. public string ChannelPrimaryImageTag { get; set; }
  951. /// <summary>
  952. /// The start date of the recording, in UTC.
  953. /// </summary>
  954. public DateTime? StartDate { get; set; }
  955. /// <summary>
  956. /// Gets or sets the completion percentage.
  957. /// </summary>
  958. /// <value>The completion percentage.</value>
  959. public double? CompletionPercentage { get; set; }
  960. /// <summary>
  961. /// Gets or sets a value indicating whether this instance is repeat.
  962. /// </summary>
  963. /// <value><c>true</c> if this instance is repeat; otherwise, <c>false</c>.</value>
  964. public bool? IsRepeat { get; set; }
  965. /// <summary>
  966. /// Gets or sets the episode title.
  967. /// </summary>
  968. /// <value>The episode title.</value>
  969. public string EpisodeTitle { get; set; }
  970. /// <summary>
  971. /// Gets or sets the type of the channel.
  972. /// </summary>
  973. /// <value>The type of the channel.</value>
  974. public ChannelType? ChannelType { get; set; }
  975. /// <summary>
  976. /// Gets or sets the audio.
  977. /// </summary>
  978. /// <value>The audio.</value>
  979. public ProgramAudio? Audio { get; set; }
  980. /// <summary>
  981. /// Gets or sets a value indicating whether this instance is movie.
  982. /// </summary>
  983. /// <value><c>true</c> if this instance is movie; otherwise, <c>false</c>.</value>
  984. public bool? IsMovie { get; set; }
  985. /// <summary>
  986. /// Gets or sets a value indicating whether this instance is sports.
  987. /// </summary>
  988. /// <value><c>true</c> if this instance is sports; otherwise, <c>false</c>.</value>
  989. public bool? IsSports { get; set; }
  990. /// <summary>
  991. /// Gets or sets a value indicating whether this instance is series.
  992. /// </summary>
  993. /// <value><c>true</c> if this instance is series; otherwise, <c>false</c>.</value>
  994. public bool? IsSeries { get; set; }
  995. /// <summary>
  996. /// Gets or sets a value indicating whether this instance is live.
  997. /// </summary>
  998. /// <value><c>true</c> if this instance is live; otherwise, <c>false</c>.</value>
  999. public bool? IsLive { get; set; }
  1000. /// <summary>
  1001. /// Gets or sets a value indicating whether this instance is news.
  1002. /// </summary>
  1003. /// <value><c>true</c> if this instance is news; otherwise, <c>false</c>.</value>
  1004. public bool? IsNews { get; set; }
  1005. /// <summary>
  1006. /// Gets or sets a value indicating whether this instance is kids.
  1007. /// </summary>
  1008. /// <value><c>true</c> if this instance is kids; otherwise, <c>false</c>.</value>
  1009. public bool? IsKids { get; set; }
  1010. /// <summary>
  1011. /// Gets or sets a value indicating whether this instance is premiere.
  1012. /// </summary>
  1013. /// <value><c>true</c> if this instance is premiere; otherwise, <c>false</c>.</value>
  1014. public bool? IsPremiere { get; set; }
  1015. /// <summary>
  1016. /// Gets or sets the timer identifier.
  1017. /// </summary>
  1018. /// <value>The timer identifier.</value>
  1019. public string TimerId { get; set; }
  1020. /// <summary>
  1021. /// Gets or sets the current program.
  1022. /// </summary>
  1023. /// <value>The current program.</value>
  1024. public BaseItemDto CurrentProgram { get; set; }
  1025. }
  1026. }