|
@@ -670,12 +670,9 @@ namespace Jellyfin.Server.Implementations.Users
|
|
/// <inheritdoc/>
|
|
/// <inheritdoc/>
|
|
public void ClearProfileImage(User user)
|
|
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)
|
|
private static bool IsValidUsername(string name)
|