BaseItemDto.cs 41 KB

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