mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-01 13:28:27 +01:00
Convert UpdateUser to solely async
This commit is contained in:
@@ -163,15 +163,6 @@ namespace Jellyfin.Server.Implementations.Users
|
||||
OnUserUpdated?.Invoke(this, new GenericEventArgs<User>(user));
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void UpdateUser(User user)
|
||||
{
|
||||
using var dbContext = _dbProvider.CreateContext();
|
||||
dbContext.Users.Update(user);
|
||||
_users[user.Id] = user;
|
||||
dbContext.SaveChanges();
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public async Task UpdateUserAsync(User user)
|
||||
{
|
||||
@@ -271,9 +262,9 @@ namespace Jellyfin.Server.Implementations.Users
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void ResetEasyPassword(User user)
|
||||
public Task ResetEasyPassword(User user)
|
||||
{
|
||||
ChangeEasyPassword(user, string.Empty, null);
|
||||
return ChangeEasyPassword(user, string.Empty, null);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
@@ -291,7 +282,7 @@ namespace Jellyfin.Server.Implementations.Users
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void ChangeEasyPassword(User user, string newPassword, string? newPasswordSha1)
|
||||
public async Task ChangeEasyPassword(User user, string newPassword, string? newPasswordSha1)
|
||||
{
|
||||
if (newPassword != null)
|
||||
{
|
||||
@@ -304,7 +295,7 @@ namespace Jellyfin.Server.Implementations.Users
|
||||
}
|
||||
|
||||
user.EasyPassword = newPasswordSha1;
|
||||
UpdateUser(user);
|
||||
await UpdateUserAsync(user);
|
||||
|
||||
_eventManager.Publish(new UserPasswordChangedEventArgs(user));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user