DTOBaseItem.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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 string TrailerUrl { get; set; }
  29. public Dictionary<string, string> ProviderIds { get; set; }
  30. public bool HasBanner { get; set; }
  31. public bool HasArt { get; set; }
  32. public bool HasLogo { get; set; }
  33. public bool HasThumb { get; set; }
  34. public bool HasPrimaryImage { get; set; }
  35. public int BackdropCount { get; set; }
  36. public IEnumerable<DTOBaseItem> Children { get; set; }
  37. public bool IsFolder { get; set; }
  38. /// <summary>
  39. /// If the item is a Folder this will determine if it's the Root or not
  40. /// </summary>
  41. public bool? IsRoot { get; set; }
  42. /// <summary>
  43. /// If the item is a Folder this will determine if it's a VF or not
  44. /// </summary>
  45. public bool? IsVirtualFolder { get; set; }
  46. public Guid? ParentId { get; set; }
  47. public string Type { get; set; }
  48. public IEnumerable<BaseItemPerson> People { get; set; }
  49. public IEnumerable<BaseItemStudio> Studios { get; set; }
  50. /// <summary>
  51. /// If the item does not have a logo, this will hold the Id of the Parent that has one.
  52. /// </summary>
  53. public Guid? ParentLogoItemId { get; set; }
  54. /// <summary>
  55. /// If the item does not have any backdrops, this will hold the Id of the Parent that has one.
  56. /// </summary>
  57. public Guid? ParentBackdropItemId { get; set; }
  58. public int? ParentBackdropCount { get; set; }
  59. public IEnumerable<DTOBaseItem> LocalTrailers { get; set; }
  60. public int LocalTrailerCount { get; set; }
  61. /// <summary>
  62. /// User data for this item based on the user it's being requested for
  63. /// </summary>
  64. public UserItemData UserData { get; set; }
  65. public ItemSpecialCounts SpecialCounts { get; set; }
  66. public bool IsType(Type type)
  67. {
  68. return IsType(type.Name);
  69. }
  70. public bool IsType(string type)
  71. {
  72. return Type.Equals(type, StringComparison.OrdinalIgnoreCase);
  73. }
  74. public bool IsNew { get; set; }
  75. }
  76. }