The Free Software Media System - Server Backend & API
Actually fix deleting profile images (hopefully)
Patrick Barron103c9b716286
diff --git a/Jellyfin.Server.Implementations/JellyfinDb.cs b/Jellyfin.Server.Implementations/JellyfinDb.csindex d3c0267e84..f574ebc66b 100644--- a/Jellyfin.Server.Implementations/JellyfinDb.cs+++ b/Jellyfin.Server.Implementations/JellyfinDb.cs@@ -23,8 +23,12 @@ namespace Jellyfin.Server.Implementations/// </summary>public static string ConnectionString { get; set; } = @"Data Source=jellyfin.db";+ public virtual DbSet<AccessSchedule> AccessSchedules { get; set; }+public virtual DbSet<ActivityLog> ActivityLogs { get; set; }+ public virtual DbSet<ImageInfo> ImageInfos { get; set; }+public virtual DbSet<Permission> Permissions { get; set; }public virtual DbSet<Preference> Preferences { get; set; }diff --git a/Jellyfin.Server.Implementations/Users/UserManager.cs b/Jellyfin.Server.Implementations/Users/UserManager.csindex 169f894672..bab6cf3fc6 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)