BaseItemDto.cs 40 KB

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