BaseItemDto.cs 40 KB

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