BaseItem.cs 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Runtime.Serialization;
  4. namespace MediaBrowser.Model.Entities
  5. {
  6. public abstract class BaseItem : BaseEntity
  7. {
  8. public string SortName { get; set; }
  9. /// <summary>
  10. /// When the item first debuted. For movies this could be premiere date, episodes would be first aired
  11. /// </summary>
  12. public DateTime? PremiereDate { get; set; }
  13. public string Path { get; set; }
  14. [IgnoreDataMember]
  15. public Folder Parent { get; set; }
  16. public string LogoImagePath { get; set; }
  17. public string ArtImagePath { get; set; }
  18. public string ThumbnailImagePath { get; set; }
  19. public string BannerImagePath { get; set; }
  20. public IEnumerable<string> BackdropImagePaths { get; set; }
  21. public string OfficialRating { get; set; }
  22. [IgnoreDataMember]
  23. public string CustomRating { get; set; }
  24. public string Overview { get; set; }
  25. public string Tagline { get; set; }
  26. [IgnoreDataMember]
  27. public IEnumerable<PersonInfo> People { get; set; }
  28. public IEnumerable<string> Studios { get; set; }
  29. public IEnumerable<string> Genres { get; set; }
  30. public string DisplayMediaType { get; set; }
  31. public float? UserRating { get; set; }
  32. public int? RunTimeInMilliseconds { get; set; }
  33. public string AspectRatio { get; set; }
  34. public int? ProductionYear { get; set; }
  35. /// <summary>
  36. /// If the item is part of a series, this is it's number in the series.
  37. /// This could be episode number, album track number, etc.
  38. /// </summary>
  39. public int? IndexNumber { get; set; }
  40. public IEnumerable<Video> LocalTrailers { get; set; }
  41. public string TrailerUrl { get; set; }
  42. public Dictionary<string, string> ProviderIds { get; set; }
  43. /// <summary>
  44. /// Gets a provider id
  45. /// </summary>
  46. public string GetProviderId(MetadataProviders provider)
  47. {
  48. return GetProviderId(provider.ToString());
  49. }
  50. /// <summary>
  51. /// Gets a provider id
  52. /// </summary>
  53. public string GetProviderId(string name)
  54. {
  55. if (ProviderIds == null)
  56. {
  57. return null;
  58. }
  59. return ProviderIds[name];
  60. }
  61. /// <summary>
  62. /// Sets a provider id
  63. /// </summary>
  64. public void SetProviderId(string name, string value)
  65. {
  66. if (ProviderIds == null)
  67. {
  68. ProviderIds = new Dictionary<string, string>();
  69. }
  70. ProviderIds[name] = value;
  71. }
  72. /// <summary>
  73. /// Sets a provider id
  74. /// </summary>
  75. public void SetProviderId(MetadataProviders provider, string value)
  76. {
  77. SetProviderId(provider.ToString(), value);
  78. }
  79. }
  80. }