ApiBaseItem.cs 1.6 KB

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