BaseItemDto.cs 30 KB

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