BaseItemDto.cs 30 KB

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