BaseItemDto.cs 28 KB

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