diff options
Diffstat (limited to 'Jellyfin.Server.Implementations/Users/UserManager.cs')
| -rw-r--r-- | Jellyfin.Server.Implementations/Users/UserManager.cs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Jellyfin.Server.Implementations/Users/UserManager.cs b/Jellyfin.Server.Implementations/Users/UserManager.cs index 169f89467..bab6cf3fc 100644 --- a/Jellyfin.Server.Implementations/Users/UserManager.cs +++ b/Jellyfin.Server.Implementations/Users/UserManager.cs @@ -670,12 +670,9 @@ namespace Jellyfin.Server.Implementations.Users /// <inheritdoc/> public void ClearProfileImage(User user) { -#nullable disable - // TODO: Remove these when User has nullable annotations - - // Can't just set the value to null, as it hasn't been loaded yet, so EF Core wouldn't see the change - _dbProvider.CreateContext().Entry(user).Reference(u => u.ProfileImage).CurrentValue = null; -#nullable enable + var dbContext = _dbProvider.CreateContext(); + dbContext.ImageInfos.Remove(user.ProfileImage); + dbContext.SaveChanges(); } private static bool IsValidUsername(string name) |
