ApiBaseItem.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. using System;
  2. using System.Collections.Generic;
  3. using MediaBrowser.Model.Entities;
  4. using MediaBrowser.Model.Users;
  5. namespace MediaBrowser.Model.DTO
  6. {
  7. /// <summary>
  8. /// This is a concrete class that the UI can use to deserialize
  9. /// It is flat in the sense that it will be used regardless of the type of BaseItem involved
  10. /// </summary>
  11. public class ApiBaseItem : BaseItem
  12. {
  13. // Series properties
  14. public string Status { get; set; }
  15. public IEnumerable<DayOfWeek> AirDays { get; set; }
  16. public string AirTime { get; set; }
  17. }
  18. /// <summary>
  19. /// This is the full return object when requesting an Item
  20. /// </summary>
  21. public class BaseItemWrapper<T>
  22. where T : BaseItem
  23. {
  24. public T Item { get; set; }
  25. public UserItemData UserItemData { get; set; }
  26. public IEnumerable<BaseItemWrapper<T>> Children { get; set; }
  27. public bool IsFolder { get; set; }
  28. public Guid? ParentId { get; set; }
  29. public string Type { get; set; }
  30. public bool IsType(Type type)
  31. {
  32. return IsType(type.Name);
  33. }
  34. public bool IsType(string type)
  35. {
  36. return Type.Equals(type, StringComparison.OrdinalIgnoreCase);
  37. }
  38. public IEnumerable<PersonInfo> People { get; set; }
  39. /// <summary>
  40. /// If the item does not have a logo, this will hold the Id of the Parent that has one.
  41. /// </summary>
  42. public Guid? ParentLogoItemId { get; set; }
  43. public Guid? ParentBackdropItemId { get; set; }
  44. public int? ParentBackdropCount { get; set; }
  45. }
  46. /// <summary>
  47. /// This is strictly for convenience so the UI's don't have to use the verbose generic syntax of BaseItemWrapper<ApiBaseItem>
  48. /// </summary>
  49. public class ApiBaseItemWrapper : BaseItemWrapper<ApiBaseItem>
  50. {
  51. }
  52. }