BaseItemDto.cs 28 KB

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