فهرست منبع

Use FirstAsync for device creation

Signed-off-by: gnattu <gnattuoc@me.com>
gnattu 1 سال پیش
والد
کامیت
dd5f6406a2
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  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;