mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-05 21:33:02 +02:00
Fix unreachable code & assign id to each profile.
This commit is contained in:
parent
557a2ad715
commit
75c9659e05
|
@ -1,5 +1,7 @@
|
||||||
#pragma warning disable CS1591
|
#pragma warning disable CS1591
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using MediaBrowser.Model.Dlna;
|
using MediaBrowser.Model.Dlna;
|
||||||
|
|
||||||
|
@ -10,6 +12,7 @@ namespace Emby.Dlna.Profiles
|
||||||
{
|
{
|
||||||
public DefaultProfile()
|
public DefaultProfile()
|
||||||
{
|
{
|
||||||
|
Id = Guid.NewGuid().ToString("N", CultureInfo.InvariantCulture);
|
||||||
Name = "Generic Device";
|
Name = "Generic Device";
|
||||||
|
|
||||||
ProtocolInfo = "http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma:*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*:image/jpeg:*,http-get:*:image/png:*,http-get:*:image/gif:*,http-get:*:image/tiff:*";
|
ProtocolInfo = "http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma:*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*:image/jpeg:*,http-get:*:image/png:*,http-get:*:image/gif:*,http-get:*:image/tiff:*";
|
||||||
|
|
|
@ -508,17 +508,18 @@ namespace Jellyfin.Api.Helpers
|
||||||
|
|
||||||
private static void ApplyDeviceProfileSettings(StreamState state, IDlnaManager dlnaManager, IDeviceManager deviceManager, HttpRequest request, string? deviceProfileId, bool? @static)
|
private static void ApplyDeviceProfileSettings(StreamState state, IDlnaManager dlnaManager, IDeviceManager deviceManager, HttpRequest request, string? deviceProfileId, bool? @static)
|
||||||
{
|
{
|
||||||
var headers = request.Headers;
|
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(deviceProfileId))
|
if (!string.IsNullOrWhiteSpace(deviceProfileId))
|
||||||
{
|
{
|
||||||
state.DeviceProfile = dlnaManager.GetProfile(deviceProfileId);
|
if (state.DeviceProfile == null)
|
||||||
}
|
{
|
||||||
else if (!string.IsNullOrWhiteSpace(deviceProfileId))
|
state.DeviceProfile = dlnaManager.GetProfile(deviceProfileId);
|
||||||
{
|
}
|
||||||
var caps = deviceManager.GetCapabilities(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;
|
var profile = state.DeviceProfile;
|
||||||
|
|
Loading…
Reference in a new issue