BaseItemDto.cs 34 KB

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