aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server.Implementations/Users/UserManager.cs
diff options
context:
space:
mode:
authorPatrick Barron <barronpm@gmail.com>2020-06-12 22:47:09 -0400
committerPatrick Barron <barronpm@gmail.com>2020-06-13 08:28:42 -0400
commit103c9b716286204011606a22156c01250d69a0fd (patch)
tree52da161779009ec1561561c84c48e5fe5b42ac36 /Jellyfin.Server.Implementations/Users/UserManager.cs
parentd0e2027b05e000b64f9cd26c6a10b8ef1f95e481 (diff)
Actually fix deleting profile images (hopefully)
Diffstat (limited to 'Jellyfin.Server.Implementations/Users/UserManager.cs')
-rw-r--r--Jellyfin.Server.Implementations/Users/UserManager.cs9
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)