UserDto.cs 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. using MediaBrowser.Model.Configuration;
  2. using MediaBrowser.Model.Connect;
  3. using MediaBrowser.Model.Users;
  4. using System;
  5. using System.Diagnostics;
  6. using MediaBrowser.Model.Serialization;
  7. namespace MediaBrowser.Model.Dto
  8. {
  9. /// <summary>
  10. /// Class UserDto
  11. /// </summary>
  12. [DebuggerDisplay("Name = {Name}, ID = {Id}, HasPassword = {HasPassword}")]
  13. public class UserDto : IItemDto, IHasServerId
  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 server identifier.
  22. /// </summary>
  23. /// <value>The server identifier.</value>
  24. public string ServerId { get; set; }
  25. /// <summary>
  26. /// Gets or sets the name of the server.
  27. /// This is not used by the server and is for client-side usage only.
  28. /// </summary>
  29. /// <value>The name of the server.</value>
  30. public string ServerName { get; set; }
  31. /// <summary>
  32. /// Gets or sets the name of the connect user.
  33. /// </summary>
  34. /// <value>The name of the connect user.</value>
  35. public string ConnectUserName { get; set; }
  36. /// <summary>
  37. /// Gets or sets the connect user identifier.
  38. /// </summary>
  39. /// <value>The connect user identifier.</value>
  40. public string ConnectUserId { get; set; }
  41. /// <summary>
  42. /// Gets or sets the type of the connect link.
  43. /// </summary>
  44. /// <value>The type of the connect link.</value>
  45. public UserLinkType? ConnectLinkType { get; set; }
  46. /// <summary>
  47. /// Gets or sets the id.
  48. /// </summary>
  49. /// <value>The id.</value>
  50. public string Id { get; set; }
  51. /// <summary>
  52. /// Gets or sets the offline password.
  53. /// </summary>
  54. /// <value>The offline password.</value>
  55. public string OfflinePassword { get; set; }
  56. /// <summary>
  57. /// Gets or sets the offline password salt.
  58. /// </summary>
  59. /// <value>The offline password salt.</value>
  60. public string OfflinePasswordSalt { get; set; }
  61. /// <summary>
  62. /// Gets or sets the primary image tag.
  63. /// </summary>
  64. /// <value>The primary image tag.</value>
  65. public string PrimaryImageTag { get; set; }
  66. /// <summary>
  67. /// Gets or sets a value indicating whether this instance has password.
  68. /// </summary>
  69. /// <value><c>true</c> if this instance has password; otherwise, <c>false</c>.</value>
  70. public bool HasPassword { get; set; }
  71. /// <summary>
  72. /// Gets or sets a value indicating whether this instance has configured password.
  73. /// </summary>
  74. /// <value><c>true</c> if this instance has configured password; otherwise, <c>false</c>.</value>
  75. public bool HasConfiguredPassword { get; set; }
  76. /// <summary>
  77. /// Gets or sets a value indicating whether this instance has configured easy password.
  78. /// </summary>
  79. /// <value><c>true</c> if this instance has configured easy password; otherwise, <c>false</c>.</value>
  80. public bool HasConfiguredEasyPassword { get; set; }
  81. public bool? EnableAutoLogin { get; set; }
  82. /// <summary>
  83. /// Gets or sets the last login date.
  84. /// </summary>
  85. /// <value>The last login date.</value>
  86. public DateTime? LastLoginDate { get; set; }
  87. /// <summary>
  88. /// Gets or sets the last activity date.
  89. /// </summary>
  90. /// <value>The last activity date.</value>
  91. public DateTime? LastActivityDate { get; set; }
  92. /// <summary>
  93. /// Gets or sets the configuration.
  94. /// </summary>
  95. /// <value>The configuration.</value>
  96. public UserConfiguration Configuration { get; set; }
  97. /// <summary>
  98. /// Gets or sets the policy.
  99. /// </summary>
  100. /// <value>The policy.</value>
  101. public UserPolicy Policy { get; set; }
  102. /// <summary>
  103. /// Gets or sets the primary image aspect ratio.
  104. /// </summary>
  105. /// <value>The primary image aspect ratio.</value>
  106. public double? PrimaryImageAspectRatio { get; set; }
  107. /// <summary>
  108. /// Gets a value indicating whether this instance has primary image.
  109. /// </summary>
  110. /// <value><c>true</c> if this instance has primary image; otherwise, <c>false</c>.</value>
  111. [IgnoreDataMember]
  112. public bool HasPrimaryImage
  113. {
  114. get { return PrimaryImageTag != null; }
  115. }
  116. /// <summary>
  117. /// Initializes a new instance of the <see cref="UserDto"/> class.
  118. /// </summary>
  119. public UserDto()
  120. {
  121. Configuration = new UserConfiguration();
  122. Policy = new UserPolicy();
  123. }
  124. public override string ToString()
  125. {
  126. return Name ?? base.ToString();
  127. }
  128. }
  129. }