Explorar o código

Use FirstAsync for device creation

Signed-off-by: gnattu <gnattuoc@me.com>
gnattu hai 1 ano
pai
achega
dd5f6406a2
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      Jellyfin.Server.Implementations/Devices/DeviceManager.cs

+ 2 - 2
Jellyfin.Server.Implementations/Devices/DeviceManager.cs

@@ -100,9 +100,9 @@ namespace Jellyfin.Server.Implementations.Devices
 
                 await dbContext.SaveChangesAsync().ConfigureAwait(false);
                 var newDevice = await dbContext.Devices
-                    .FirstOrDefaultAsync(d => d.Id == device.Id)
+                    .FirstAsync(d => d.Id == device.Id)
                     .ConfigureAwait(false);
-                _devices.TryAdd(device.Id, newDevice!);
+                _devices.TryAdd(device.Id, newDevice);
             }
 
             return device;