From 7f12677dc3a1aff4567003ca9091ee522b6d62d5 Mon Sep 17 00:00:00 2001 From: gnattu Date: Tue, 2 Jul 2024 03:11:44 +0800 Subject: [PATCH] Directly add new device to cache Signed-off-by: gnattu --- Jellyfin.Server.Implementations/Devices/DeviceManager.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Jellyfin.Server.Implementations/Devices/DeviceManager.cs b/Jellyfin.Server.Implementations/Devices/DeviceManager.cs index 580358b2a8..387cc990ea 100644 --- a/Jellyfin.Server.Implementations/Devices/DeviceManager.cs +++ b/Jellyfin.Server.Implementations/Devices/DeviceManager.cs @@ -97,12 +97,8 @@ namespace Jellyfin.Server.Implementations.Devices await using (dbContext.ConfigureAwait(false)) { dbContext.Devices.Add(device); - await dbContext.SaveChangesAsync().ConfigureAwait(false); - var newDevice = await dbContext.Devices - .FirstAsync(d => d.Id == device.Id) - .ConfigureAwait(false); - _devices.TryAdd(device.Id, newDevice); + _devices.TryAdd(device.Id, device); } return device;