Use FirstAsync for device creation

Signed-off-by: gnattu <gnattuoc@me.com>
This commit is contained in:
gnattu 2024-06-29 14:08:24 +08:00
parent 79c0a7d7f0
commit dd5f6406a2

View File

@ -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;