BaseItemDto.cs 31 KB

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