BaseItemDto.cs 26 KB

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