Person.cs 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. using MediaBrowser.Controller.Providers;
  2. using MediaBrowser.Model.Dto;
  3. using System.Collections.Generic;
  4. using System.Runtime.Serialization;
  5. namespace MediaBrowser.Controller.Entities
  6. {
  7. /// <summary>
  8. /// This is the full Person object that can be retrieved with all of it's data.
  9. /// </summary>
  10. public class Person : BaseItem, IItemByName, IHasLookupInfo<PersonLookupInfo>
  11. {
  12. public Person()
  13. {
  14. UserItemCountList = new List<ItemByNameCounts>();
  15. }
  16. /// <summary>
  17. /// Gets or sets the place of birth.
  18. /// </summary>
  19. /// <value>The place of birth.</value>
  20. public string PlaceOfBirth { get; set; }
  21. [IgnoreDataMember]
  22. public List<ItemByNameCounts> UserItemCountList { get; set; }
  23. /// <summary>
  24. /// Gets the user data key.
  25. /// </summary>
  26. /// <returns>System.String.</returns>
  27. public override string GetUserDataKey()
  28. {
  29. return "Person-" + Name;
  30. }
  31. public PersonLookupInfo GetLookupInfo()
  32. {
  33. return GetItemLookupInfo<PersonLookupInfo>();
  34. }
  35. /// <summary>
  36. /// Returns the folder containing the item.
  37. /// If the item is a folder, it returns the folder itself
  38. /// </summary>
  39. /// <value>The containing folder path.</value>
  40. public override string ContainingFolderPath
  41. {
  42. get
  43. {
  44. return Path;
  45. }
  46. }
  47. /// <summary>
  48. /// Gets a value indicating whether this instance is owned item.
  49. /// </summary>
  50. /// <value><c>true</c> if this instance is owned item; otherwise, <c>false</c>.</value>
  51. public override bool IsOwnedItem
  52. {
  53. get
  54. {
  55. return false;
  56. }
  57. }
  58. }
  59. /// <summary>
  60. /// This is the small Person stub that is attached to BaseItems
  61. /// </summary>
  62. public class PersonInfo
  63. {
  64. /// <summary>
  65. /// Gets or sets the name.
  66. /// </summary>
  67. /// <value>The name.</value>
  68. public string Name { get; set; }
  69. /// <summary>
  70. /// Gets or sets the role.
  71. /// </summary>
  72. /// <value>The role.</value>
  73. public string Role { get; set; }
  74. /// <summary>
  75. /// Gets or sets the type.
  76. /// </summary>
  77. /// <value>The type.</value>
  78. public string Type { get; set; }
  79. /// <summary>
  80. /// Gets or sets the sort order - ascending
  81. /// </summary>
  82. /// <value>The sort order.</value>
  83. public int? SortOrder { get; set; }
  84. /// <summary>
  85. /// Returns a <see cref="System.String" /> that represents this instance.
  86. /// </summary>
  87. /// <returns>A <see cref="System.String" /> that represents this instance.</returns>
  88. public override string ToString()
  89. {
  90. return Name;
  91. }
  92. }
  93. }