ApiBaseItem.cs 1.7 KB

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