PersonInfo.cs 1.7 KB

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