DTOBaseItem.cs 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. using System;
  2. using System.Collections.Generic;
  3. using MediaBrowser.Model.Entities;
  4. namespace MediaBrowser.Model.DTO
  5. {
  6. /// <summary>
  7. /// This is strictly used as a data transfer object from the api layer.
  8. /// This holds information about a BaseItem in a format that is convenient for the client.
  9. /// </summary>
  10. public class DTOBaseItem : IHasProviderIds
  11. {
  12. public string Name { get; set; }
  13. public Guid Id { get; set; }
  14. public DateTime DateCreated { get; set; }
  15. public string SortName { get; set; }
  16. public DateTime? PremiereDate { get; set; }
  17. public string Path { get; set; }
  18. public string OfficialRating { get; set; }
  19. public string Overview { get; set; }
  20. public IEnumerable<string> Taglines { get; set; }
  21. public IEnumerable<string> Genres { get; set; }
  22. public string DisplayMediaType { get; set; }
  23. public float? UserRating { get; set; }
  24. public long? RunTimeTicks { get; set; }
  25. public string AspectRatio { get; set; }
  26. public int? ProductionYear { get; set; }
  27. public int? IndexNumber { get; set; }
  28. public int? ParentIndexNumber { get; set; }
  29. public string TrailerUrl { get; set; }
  30. public Dictionary<string, string> ProviderIds { get; set; }
  31. public bool HasBanner { get; set; }
  32. public bool HasArt { get; set; }
  33. public bool HasLogo { get; set; }
  34. public bool HasThumb { get; set; }
  35. public bool HasPrimaryImage { get; set; }
  36. public string Language { get; set; }
  37. public int BackdropCount { get; set; }
  38. public IEnumerable<DTOBaseItem> Children { get; set; }
  39. public bool IsFolder { get; set; }
  40. /// <summary>
  41. /// If the item is a Folder this will determine if it's the Root or not
  42. /// </summary>
  43. public bool? IsRoot { get; set; }
  44. /// <summary>
  45. /// If the item is a Folder this will determine if it's a VF or not
  46. /// </summary>
  47. public bool? IsVirtualFolder { get; set; }
  48. public Guid? ParentId { get; set; }
  49. public string Type { get; set; }
  50. public IEnumerable<BaseItemPerson> People { get; set; }
  51. public IEnumerable<BaseItemStudio> Studios { get; set; }
  52. /// <summary>
  53. /// If the item does not have a logo, this will hold the Id of the Parent that has one.
  54. /// </summary>
  55. public Guid? ParentLogoItemId { get; set; }
  56. /// <summary>
  57. /// If the item does not have any backdrops, this will hold the Id of the Parent that has one.
  58. /// </summary>
  59. public Guid? ParentBackdropItemId { get; set; }
  60. public int? ParentBackdropCount { get; set; }
  61. public IEnumerable<DTOBaseItem> LocalTrailers { get; set; }
  62. public int LocalTrailerCount { get; set; }
  63. /// <summary>
  64. /// User data for this item based on the user it's being requested for
  65. /// </summary>
  66. public UserItemData UserData { get; set; }
  67. public ItemSpecialCounts SpecialCounts { get; set; }
  68. public AudioInfo AudioInfo { get; set; }
  69. public bool IsType(Type type)
  70. {
  71. return IsType(type.Name);
  72. }
  73. public bool IsType(string type)
  74. {
  75. return Type.Equals(type, StringComparison.OrdinalIgnoreCase);
  76. }
  77. public bool IsNew { get; set; }
  78. }
  79. }