BaseItemDto.cs 32 KB

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