BaseItemDto.cs 30 KB

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