소스 검색

Directly add new device to cache

Signed-off-by: gnattu <gnattuoc@me.com>
gnattu 11 달 전
부모
커밋
7f12677dc3
1개의 변경된 파일1개의 추가작업 그리고 5개의 파일을 삭제
  1. 1 5
      Jellyfin.Server.Implementations/Devices/DeviceManager.cs

+ 1 - 5
Jellyfin.Server.Implementations/Devices/DeviceManager.cs

@@ -97,12 +97,8 @@ namespace Jellyfin.Server.Implementations.Devices
             await using (dbContext.ConfigureAwait(false))
             await using (dbContext.ConfigureAwait(false))
             {
             {
                 dbContext.Devices.Add(device);
                 dbContext.Devices.Add(device);
-
                 await dbContext.SaveChangesAsync().ConfigureAwait(false);
                 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;
             return device;