PersonInfo.cs 1.8 KB

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