BaseItemDto.cs 40 KB

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