BaseItemPerson.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #nullable disable
  2. using System;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Text.Json.Serialization;
  6. using Jellyfin.Data.Enums;
  7. using MediaBrowser.Model.Entities;
  8. namespace MediaBrowser.Model.Dto
  9. {
  10. /// <summary>
  11. /// This is used by the api to get information about a Person within a BaseItem.
  12. /// </summary>
  13. public class BaseItemPerson
  14. {
  15. /// <summary>
  16. /// Gets or sets the name.
  17. /// </summary>
  18. /// <value>The name.</value>
  19. public string Name { get; set; }
  20. /// <summary>
  21. /// Gets or sets the identifier.
  22. /// </summary>
  23. /// <value>The identifier.</value>
  24. public Guid Id { get; set; }
  25. /// <summary>
  26. /// Gets or sets the role.
  27. /// </summary>
  28. /// <value>The role.</value>
  29. public string Role { get; set; }
  30. /// <summary>
  31. /// Gets or sets the type.
  32. /// </summary>
  33. /// <value>The type.</value>
  34. [DefaultValue(PersonKind.Unknown)]
  35. public PersonKind Type { get; set; }
  36. /// <summary>
  37. /// Gets or sets the primary image tag.
  38. /// </summary>
  39. /// <value>The primary image tag.</value>
  40. public string PrimaryImageTag { get; set; }
  41. /// <summary>
  42. /// Gets or sets the primary image blurhash.
  43. /// </summary>
  44. /// <value>The primary image blurhash.</value>
  45. public Dictionary<ImageType, Dictionary<string, string>> ImageBlurHashes { get; set; }
  46. /// <summary>
  47. /// Gets a value indicating whether this instance has primary image.
  48. /// </summary>
  49. /// <value><c>true</c> if this instance has primary image; otherwise, <c>false</c>.</value>
  50. [JsonIgnore]
  51. public bool HasPrimaryImage => PrimaryImageTag is not null;
  52. }
  53. }