BaseItemInfo.cs 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. using ProtoBuf;
  2. using System;
  3. using System.Runtime.Serialization;
  4. namespace MediaBrowser.Model.Entities
  5. {
  6. /// <summary>
  7. /// This is a stub class containing only basic information about an item
  8. /// </summary>
  9. [ProtoContract]
  10. public class BaseItemInfo
  11. {
  12. /// <summary>
  13. /// Gets or sets the name.
  14. /// </summary>
  15. /// <value>The name.</value>
  16. [ProtoMember(1)]
  17. public string Name { get; set; }
  18. /// <summary>
  19. /// Gets or sets the id.
  20. /// </summary>
  21. /// <value>The id.</value>
  22. [ProtoMember(2)]
  23. public string Id { get; set; }
  24. /// <summary>
  25. /// Gets or sets the type.
  26. /// </summary>
  27. /// <value>The type.</value>
  28. [ProtoMember(3)]
  29. public string Type { get; set; }
  30. /// <summary>
  31. /// Gets or sets a value indicating whether this instance is folder.
  32. /// </summary>
  33. /// <value><c>true</c> if this instance is folder; otherwise, <c>false</c>.</value>
  34. [ProtoMember(4)]
  35. public bool IsFolder { get; set; }
  36. /// <summary>
  37. /// Gets or sets the run time ticks.
  38. /// </summary>
  39. /// <value>The run time ticks.</value>
  40. [ProtoMember(5)]
  41. public long? RunTimeTicks { get; set; }
  42. /// <summary>
  43. /// Gets or sets the primary image tag.
  44. /// </summary>
  45. /// <value>The primary image tag.</value>
  46. [ProtoMember(6)]
  47. public Guid? PrimaryImageTag { get; set; }
  48. /// <summary>
  49. /// Gets or sets the backdrop image tag.
  50. /// </summary>
  51. /// <value>The backdrop image tag.</value>
  52. [ProtoMember(7)]
  53. public Guid? BackdropImageTag { get; set; }
  54. /// <summary>
  55. /// Gets a value indicating whether this instance has primary image.
  56. /// </summary>
  57. /// <value><c>true</c> if this instance has primary image; otherwise, <c>false</c>.</value>
  58. [IgnoreDataMember]
  59. public bool HasPrimaryImage
  60. {
  61. get { return PrimaryImageTag.HasValue; }
  62. }
  63. /// <summary>
  64. /// Gets a value indicating whether this instance has backdrop.
  65. /// </summary>
  66. /// <value><c>true</c> if this instance has backdrop; otherwise, <c>false</c>.</value>
  67. [IgnoreDataMember]
  68. public bool HasBackdrop
  69. {
  70. get { return BackdropImageTag.HasValue; }
  71. }
  72. }
  73. }