PersonInfo.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #nullable disable
  2. #pragma warning disable CA2227, CS1591
  3. using System;
  4. using System.Collections.Generic;
  5. using MediaBrowser.Model.Entities;
  6. namespace MediaBrowser.Controller.Entities
  7. {
  8. /// <summary>
  9. /// This is a small Person stub that is attached to BaseItems.
  10. /// </summary>
  11. public sealed class PersonInfo : IHasProviderIds
  12. {
  13. public PersonInfo()
  14. {
  15. ProviderIds = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
  16. }
  17. public Guid ItemId { get; set; }
  18. /// <summary>
  19. /// Gets or sets the name.
  20. /// </summary>
  21. /// <value>The name.</value>
  22. public string Name { get; set; }
  23. /// <summary>
  24. /// Gets or sets the role.
  25. /// </summary>
  26. /// <value>The role.</value>
  27. public string Role { get; set; }
  28. /// <summary>
  29. /// Gets or sets the type.
  30. /// </summary>
  31. /// <value>The type.</value>
  32. public string Type { get; set; }
  33. /// <summary>
  34. /// Gets or sets the ascending sort order.
  35. /// </summary>
  36. /// <value>The sort order.</value>
  37. public int? SortOrder { get; set; }
  38. public string ImageUrl { get; set; }
  39. public Dictionary<string, string> ProviderIds { get; set; }
  40. /// <summary>
  41. /// Returns a <see cref="string" /> that represents this instance.
  42. /// </summary>
  43. /// <returns>A <see cref="string" /> that represents this instance.</returns>
  44. public override string ToString()
  45. {
  46. return Name;
  47. }
  48. public bool IsType(string type)
  49. {
  50. return string.Equals(Type, type, StringComparison.OrdinalIgnoreCase)
  51. || string.Equals(Role, type, StringComparison.OrdinalIgnoreCase);
  52. }
  53. }
  54. }