BaseItemDto.cs 26 KB

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