BaseItemDto.cs 31 KB

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