BaseItemDto.cs 40 KB

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