ApiBaseItem.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. }
  13. /// <summary>
  14. /// This is the full return object when requesting an Item
  15. /// </summary>
  16. public class ApiBaseItemWrapper<T>
  17. where T : BaseItem
  18. {
  19. public T Item { get; set; }
  20. public UserItemData UserItemData { get; set; }
  21. public IEnumerable<ApiBaseItemWrapper<T>> Children { get; set; }
  22. public bool IsFolder { get; set; }
  23. public Guid? ParentId { get; set; }
  24. public string Type { get; set; }
  25. public bool IsType(Type type)
  26. {
  27. return IsType(type.Name);
  28. }
  29. public bool IsType(string type)
  30. {
  31. return Type.Equals(type, StringComparison.OrdinalIgnoreCase);
  32. }
  33. /// <summary>
  34. /// If the item does not have a logo, this will hold the Id of the Parent that has one.
  35. /// </summary>
  36. public Guid? ParentLogoItemId { get; set; }
  37. public Guid? ParentBackdropItemId { get; set; }
  38. public int? ParentBackdropCount { get; set; }
  39. }
  40. }