BaseItemDto.cs 40 KB

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