mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-19 07:06:48 +01:00
Refactored all UserManager db access methods
Fixed stale cached entities in UserManager Fixed wrong state persisting though method calls
This commit is contained in:
@@ -24,14 +24,14 @@ namespace MediaBrowser.Controller.Library
|
||||
/// <summary>
|
||||
/// Gets the users.
|
||||
/// </summary>
|
||||
/// <value>The users.</value>
|
||||
IEnumerable<User> Users { get; }
|
||||
/// <returns>The users.</returns>
|
||||
IEnumerable<User> GetUsers();
|
||||
|
||||
/// <summary>
|
||||
/// Gets the user ids.
|
||||
/// </summary>
|
||||
/// <value>The users ids.</value>
|
||||
IEnumerable<Guid> UsersIds { get; }
|
||||
/// <returns>The users ids.</returns>
|
||||
IEnumerable<Guid> GetUsersIds();
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the user manager and ensures that a user exists.
|
||||
@@ -47,6 +47,12 @@ namespace MediaBrowser.Controller.Library
|
||||
/// <exception cref="ArgumentException"><c>id</c> is an empty Guid.</exception>
|
||||
User? GetUserById(Guid id);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the first available user.
|
||||
/// </summary>
|
||||
/// <returns>The first user, or <c>null</c> if no users exist.</returns>
|
||||
User? GetFirstUser();
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of the user by.
|
||||
/// </summary>
|
||||
@@ -57,12 +63,13 @@ namespace MediaBrowser.Controller.Library
|
||||
/// <summary>
|
||||
/// Renames the user.
|
||||
/// </summary>
|
||||
/// <param name="user">The user.</param>
|
||||
/// <param name="userId">The UserId to change.</param>
|
||||
/// <param name="oldName">The old Username.</param>
|
||||
/// <param name="newName">The new name.</param>
|
||||
/// <returns>Task.</returns>
|
||||
/// <exception cref="ArgumentNullException">If user is <c>null</c>.</exception>
|
||||
/// <exception cref="ArgumentException">If the provided user doesn't exist.</exception>
|
||||
Task RenameUser(User user, string newName);
|
||||
Task RenameUser(Guid userId, string oldName, string newName);
|
||||
|
||||
/// <summary>
|
||||
/// Updates the user.
|
||||
|
||||
Reference in New Issue
Block a user