BaseItemDto.cs 29 KB

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