aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server.Implementations
diff options
context:
space:
mode:
authorPatrick Barron <barronpm@gmail.com>2021-06-27 16:42:26 -0400
committerPatrick Barron <barronpm@gmail.com>2021-06-27 16:42:26 -0400
commitbbac9ff67e60d243dbd05be60abfcf13c295cd84 (patch)
treefdf34a0f712e3feb97b014eb51a90172c837e88d /Jellyfin.Server.Implementations
parentd3e02e918d5586b0b8c74f1b79a13b76a978defd (diff)
GetDeviceOptions always returns an instance of DeviceOptions
Diffstat (limited to 'Jellyfin.Server.Implementations')
-rw-r--r--Jellyfin.Server.Implementations/Devices/DeviceManager.cs6
1 files changed, 4 insertions, 2 deletions
diff --git a/Jellyfin.Server.Implementations/Devices/DeviceManager.cs b/Jellyfin.Server.Implementations/Devices/DeviceManager.cs
index 484a53428..b02ca4ef0 100644
--- a/Jellyfin.Server.Implementations/Devices/DeviceManager.cs
+++ b/Jellyfin.Server.Implementations/Devices/DeviceManager.cs
@@ -74,13 +74,15 @@ namespace Jellyfin.Server.Implementations.Devices
}
/// <inheritdoc />
- public async Task<DeviceOptions?> GetDeviceOptions(string deviceId)
+ public async Task<DeviceOptions> GetDeviceOptions(string deviceId)
{
await using var dbContext = _dbProvider.CreateContext();
- return await dbContext.DeviceOptions
+ var deviceOptions = await dbContext.DeviceOptions
.AsQueryable()
.FirstOrDefaultAsync(d => d.DeviceId == deviceId)
.ConfigureAwait(false);
+
+ return deviceOptions ?? new DeviceOptions(deviceId);
}
/// <inheritdoc />