BaseItemDto.cs 34 KB

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