mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-07 03:48:06 +02:00
Merge pull request #4485 from crobibero/update-user-cache
Update user cache after updating user.
This commit is contained in:
commit
84b0932cfe
1 changed files with 5 additions and 2 deletions
|
@ -158,7 +158,6 @@ namespace Jellyfin.Server.Implementations.Users
|
||||||
|
|
||||||
user.Username = newName;
|
user.Username = newName;
|
||||||
await UpdateUserAsync(user).ConfigureAwait(false);
|
await UpdateUserAsync(user).ConfigureAwait(false);
|
||||||
|
|
||||||
OnUserUpdated?.Invoke(this, new GenericEventArgs<User>(user));
|
OnUserUpdated?.Invoke(this, new GenericEventArgs<User>(user));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -167,6 +166,7 @@ namespace Jellyfin.Server.Implementations.Users
|
||||||
{
|
{
|
||||||
using var dbContext = _dbProvider.CreateContext();
|
using var dbContext = _dbProvider.CreateContext();
|
||||||
dbContext.Users.Update(user);
|
dbContext.Users.Update(user);
|
||||||
|
_users[user.Id] = user;
|
||||||
dbContext.SaveChanges();
|
dbContext.SaveChanges();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -175,7 +175,7 @@ namespace Jellyfin.Server.Implementations.Users
|
||||||
{
|
{
|
||||||
await using var dbContext = _dbProvider.CreateContext();
|
await using var dbContext = _dbProvider.CreateContext();
|
||||||
dbContext.Users.Update(user);
|
dbContext.Users.Update(user);
|
||||||
|
_users[user.Id] = user;
|
||||||
await dbContext.SaveChangesAsync().ConfigureAwait(false);
|
await dbContext.SaveChangesAsync().ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -642,6 +642,7 @@ namespace Jellyfin.Server.Implementations.Users
|
||||||
user.SetPreference(PreferenceKind.LatestItemExcludes, config.LatestItemsExcludes);
|
user.SetPreference(PreferenceKind.LatestItemExcludes, config.LatestItemsExcludes);
|
||||||
|
|
||||||
dbContext.Update(user);
|
dbContext.Update(user);
|
||||||
|
_users[user.Id] = user;
|
||||||
await dbContext.SaveChangesAsync().ConfigureAwait(false);
|
await dbContext.SaveChangesAsync().ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -713,6 +714,7 @@ namespace Jellyfin.Server.Implementations.Users
|
||||||
user.SetPreference(PreferenceKind.EnableContentDeletionFromFolders, policy.EnableContentDeletionFromFolders);
|
user.SetPreference(PreferenceKind.EnableContentDeletionFromFolders, policy.EnableContentDeletionFromFolders);
|
||||||
|
|
||||||
dbContext.Update(user);
|
dbContext.Update(user);
|
||||||
|
_users[user.Id] = user;
|
||||||
await dbContext.SaveChangesAsync().ConfigureAwait(false);
|
await dbContext.SaveChangesAsync().ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -723,6 +725,7 @@ namespace Jellyfin.Server.Implementations.Users
|
||||||
dbContext.Remove(user.ProfileImage);
|
dbContext.Remove(user.ProfileImage);
|
||||||
await dbContext.SaveChangesAsync().ConfigureAwait(false);
|
await dbContext.SaveChangesAsync().ConfigureAwait(false);
|
||||||
user.ProfileImage = null;
|
user.ProfileImage = null;
|
||||||
|
_users[user.Id] = user;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool IsValidUsername(string name)
|
private static bool IsValidUsername(string name)
|
||||||
|
|
Loading…
Reference in a new issue