BaseItemDto.cs 41 KB

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