The Free Software Media System - Server Backend & API
Fix bugs for fresh installs.
Patrick Barron4d559b4ec45c
diff --git a/Jellyfin.Server.Implementations/Users/UserManager.cs b/Jellyfin.Server.Implementations/Users/UserManager.csindex 0ea13f4e73..d05fc2549d 100644--- a/Jellyfin.Server.Implementations/Users/UserManager.cs+++ b/Jellyfin.Server.Implementations/Users/UserManager.cs@@ -22,6 +22,7 @@ using MediaBrowser.Model.Cryptography;using MediaBrowser.Model.Dto;using MediaBrowser.Model.Events;using MediaBrowser.Model.Users;+using Microsoft.EntityFrameworkCore.Internal;using Microsoft.Extensions.Logging;namespace Jellyfin.Server.Implementations.Users@@ -174,7 +175,7 @@ namespace Jellyfin.Server.Implementations.Usersvar dbContext = _dbProvider.CreateContext();// TODO: Remove after user item data is migrated.- var max = dbContext.Users.Select(u => u.InternalId).Max();+ var max = dbContext.Users.Any() ? dbContext.Users.Select(u => u.InternalId).Max() : 0;var newUser = new User(name,@@ -549,7 +550,7 @@ namespace Jellyfin.Server.Implementations.UsersnewUser.SetPermission(PermissionKind.EnableContentDeletion, true);newUser.SetPermission(PermissionKind.EnableRemoteControlOfOtherUsers, true);- dbContext.Users.Add(newUser);+ dbContext.Users.Update(newUser);dbContext.SaveChanges();}