diff options
| author | Patrick Barron <barronpm@gmail.com> | 2021-04-10 16:57:25 -0400 |
|---|---|---|
| committer | Patrick Barron <barronpm@gmail.com> | 2021-04-10 16:57:25 -0400 |
| commit | 8607b5254142662e79dbf826d43375ce60727cfe (patch) | |
| tree | 71f62045c84ab6f2e11f15bcdd0cc157ac1dcbbe /Jellyfin.Server.Implementations/Devices/DeviceManager.cs | |
| parent | 44e71774b17942034691d6a2c630cd687b23bceb (diff) | |
Make device/session code async
Diffstat (limited to 'Jellyfin.Server.Implementations/Devices/DeviceManager.cs')
| -rw-r--r-- | Jellyfin.Server.Implementations/Devices/DeviceManager.cs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Jellyfin.Server.Implementations/Devices/DeviceManager.cs b/Jellyfin.Server.Implementations/Devices/DeviceManager.cs index c942678d9..0d93ee2bf 100644 --- a/Jellyfin.Server.Implementations/Devices/DeviceManager.cs +++ b/Jellyfin.Server.Implementations/Devices/DeviceManager.cs @@ -53,12 +53,13 @@ namespace Jellyfin.Server.Implementations.Devices } /// <inheritdoc /> - public DeviceOptions? GetDeviceOptions(string deviceId) + public async Task<DeviceOptions?> GetDeviceOptions(string deviceId) { - using var dbContext = _dbProvider.CreateContext(); - return dbContext.DeviceOptions + await using var dbContext = _dbProvider.CreateContext(); + return await dbContext.DeviceOptions .AsQueryable() - .FirstOrDefault(d => d.DeviceId == deviceId); + .FirstOrDefaultAsync(d => d.DeviceId == deviceId) + .ConfigureAwait(false); } /// <inheritdoc /> |
