diff options
| author | BaronGreenback <jimcartlidge@yahoo.co.uk> | 2021-03-07 14:17:32 +0000 |
|---|---|---|
| committer | BaronGreenback <jimcartlidge@yahoo.co.uk> | 2021-03-07 14:17:32 +0000 |
| commit | 75c9659e05363f2e29e01757dc66f14f3f20f318 (patch) | |
| tree | 98d3e8d6d2ffb6cb916e37be89fd3f115427fbea /Jellyfin.Api/Helpers/StreamingHelpers.cs | |
| parent | 557a2ad7158b14ae97fa503a551ed17251b97ca0 (diff) | |
Fix unreachable code & assign id to each profile.
Diffstat (limited to 'Jellyfin.Api/Helpers/StreamingHelpers.cs')
| -rw-r--r-- | Jellyfin.Api/Helpers/StreamingHelpers.cs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/Jellyfin.Api/Helpers/StreamingHelpers.cs b/Jellyfin.Api/Helpers/StreamingHelpers.cs index d20a02cf5..6bc5524cb 100644 --- a/Jellyfin.Api/Helpers/StreamingHelpers.cs +++ b/Jellyfin.Api/Helpers/StreamingHelpers.cs @@ -508,17 +508,18 @@ namespace Jellyfin.Api.Helpers private static void ApplyDeviceProfileSettings(StreamState state, IDlnaManager dlnaManager, IDeviceManager deviceManager, HttpRequest request, string? deviceProfileId, bool? @static) { - var headers = request.Headers; - if (!string.IsNullOrWhiteSpace(deviceProfileId)) { - state.DeviceProfile = dlnaManager.GetProfile(deviceProfileId); - } - else if (!string.IsNullOrWhiteSpace(deviceProfileId)) - { - var caps = deviceManager.GetCapabilities(deviceProfileId); + if (state.DeviceProfile == null) + { + state.DeviceProfile = dlnaManager.GetProfile(deviceProfileId); + } - state.DeviceProfile = caps == null ? dlnaManager.GetProfile(headers) : caps.DeviceProfile; + if (state.DeviceProfile == null) + { + var caps = deviceManager.GetCapabilities(deviceProfileId); + state.DeviceProfile = caps == null ? dlnaManager.GetProfile(request.Headers) : caps.DeviceProfile; + } } var profile = state.DeviceProfile; |
