diff options
| author | Patrick Barron <barronpm@gmail.com> | 2020-06-12 22:47:09 -0400 |
|---|---|---|
| committer | Patrick Barron <barronpm@gmail.com> | 2020-06-13 08:28:42 -0400 |
| commit | 103c9b716286204011606a22156c01250d69a0fd (patch) | |
| tree | 52da161779009ec1561561c84c48e5fe5b42ac36 /Jellyfin.Server.Implementations/Users/UserManager.cs | |
| parent | d0e2027b05e000b64f9cd26c6a10b8ef1f95e481 (diff) | |
Actually fix deleting profile images (hopefully)
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) |
