GetDeviceOptions always returns an instance of DeviceOptions

This commit is contained in:
Patrick Barron
2021-06-27 16:42:26 -04:00
parent d3e02e918d
commit bbac9ff67e
3 changed files with 5 additions and 9 deletions

View File

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