mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
fix xbox one, ps4 not seeing dlna server
This commit is contained in:
parent
5bf7e6d80c
commit
cc98b04c5d
@ -488,7 +488,9 @@ namespace MediaBrowser.Dlna
|
|||||||
var profile = GetProfile(headers) ??
|
var profile = GetProfile(headers) ??
|
||||||
GetDefaultProfile();
|
GetDefaultProfile();
|
||||||
|
|
||||||
return new DescriptionXmlBuilder(profile, serverUuId, serverAddress, _appHost.FriendlyName, serverUuId.GetMD5().ToString("N")).GetXml();
|
var serverId = _appHost.SystemId;
|
||||||
|
|
||||||
|
return new DescriptionXmlBuilder(profile, serverUuId, serverAddress, _appHost.FriendlyName, serverId).GetXml();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ImageStream GetIcon(string filename)
|
public ImageStream GetIcon(string filename)
|
||||||
|
@ -157,9 +157,9 @@ namespace MediaBrowser.Dlna.Main
|
|||||||
//}
|
//}
|
||||||
|
|
||||||
var addressString = address.ToString();
|
var addressString = address.ToString();
|
||||||
var guid = addressString.GetMD5();
|
var udn = addressString.GetMD5().ToString("N");
|
||||||
|
|
||||||
var descriptorURI = "/dlna/" + guid.ToString("N") + "/description.xml";
|
var descriptorURI = "/dlna/" + udn + "/description.xml";
|
||||||
|
|
||||||
var uri = new Uri(_appHost.GetLocalApiUrl(addressString) + descriptorURI);
|
var uri = new Uri(_appHost.GetLocalApiUrl(addressString) + descriptorURI);
|
||||||
|
|
||||||
@ -170,12 +170,12 @@ namespace MediaBrowser.Dlna.Main
|
|||||||
"urn:schemas-upnp-org:service:ContentDirectory:1",
|
"urn:schemas-upnp-org:service:ContentDirectory:1",
|
||||||
"urn:schemas-upnp-org:service:ConnectionManager:1",
|
"urn:schemas-upnp-org:service:ConnectionManager:1",
|
||||||
"urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1",
|
"urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1",
|
||||||
"uuid:" + guid.ToString("N")
|
"uuid:" + udn
|
||||||
};
|
};
|
||||||
|
|
||||||
_ssdpHandler.RegisterNotification(guid, uri, address, services);
|
_ssdpHandler.RegisterNotification(udn, uri, address, services);
|
||||||
|
|
||||||
_registeredServerIds.Add(guid.ToString("N"));
|
_registeredServerIds.Add(udn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -240,7 +240,7 @@ namespace MediaBrowser.Dlna.Main
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_ssdpHandler.UnregisterNotification(new Guid(id));
|
_ssdpHandler.UnregisterNotification(id);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
@ -122,7 +122,7 @@ namespace MediaBrowser.Dlna.Server
|
|||||||
builder.Append("<serialNumber>" + SecurityElement.Escape(_profile.SerialNumber) + "</serialNumber>");
|
builder.Append("<serialNumber>" + SecurityElement.Escape(_profile.SerialNumber) + "</serialNumber>");
|
||||||
}
|
}
|
||||||
|
|
||||||
builder.Append("<UDN>uuid:" + SecurityElement.Escape(_serverId) + "</UDN>");
|
builder.Append("<UDN>uuid:" + SecurityElement.Escape(_serverUdn) + "</UDN>");
|
||||||
builder.Append("<presentationURL>" + SecurityElement.Escape(_serverAddress) + "</presentationURL>");
|
builder.Append("<presentationURL>" + SecurityElement.Escape(_serverAddress) + "</presentationURL>");
|
||||||
|
|
||||||
if (!EnableAbsoluteUrls)
|
if (!EnableAbsoluteUrls)
|
||||||
|
@ -8,10 +8,10 @@ namespace MediaBrowser.Dlna.Server
|
|||||||
public readonly Uri Descriptor;
|
public readonly Uri Descriptor;
|
||||||
public readonly string Type;
|
public readonly string Type;
|
||||||
public readonly string USN;
|
public readonly string USN;
|
||||||
public readonly Guid Uuid;
|
public readonly string Uuid;
|
||||||
public readonly IPAddress Address;
|
public readonly IPAddress Address;
|
||||||
|
|
||||||
public UpnpDevice(Guid aUuid, string aType, Uri aDescriptor, IPAddress address)
|
public UpnpDevice(string aUuid, string aType, Uri aDescriptor, IPAddress address)
|
||||||
{
|
{
|
||||||
Uuid = aUuid;
|
Uuid = aUuid;
|
||||||
Type = aType;
|
Type = aType;
|
||||||
@ -25,7 +25,7 @@ namespace MediaBrowser.Dlna.Server
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
USN = String.Format("uuid:{0}::{1}", Uuid.ToString("N"), Type);
|
USN = String.Format("uuid:{0}::{1}", Uuid, Type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ namespace MediaBrowser.Dlna.Ssdp
|
|||||||
private Timer _notificationTimer;
|
private Timer _notificationTimer;
|
||||||
|
|
||||||
private bool _isDisposed;
|
private bool _isDisposed;
|
||||||
private readonly ConcurrentDictionary<Guid, List<UpnpDevice>> _devices = new ConcurrentDictionary<Guid, List<UpnpDevice>>();
|
private readonly ConcurrentDictionary<string, List<UpnpDevice>> _devices = new ConcurrentDictionary<string, List<UpnpDevice>>();
|
||||||
|
|
||||||
private readonly IApplicationHost _appHost;
|
private readonly IApplicationHost _appHost;
|
||||||
|
|
||||||
@ -451,7 +451,7 @@ namespace MediaBrowser.Dlna.Ssdp
|
|||||||
SendDatagram(msg, _ssdpEndp, new IPEndPoint(dev.Address, 0), true);
|
SendDatagram(msg, _ssdpEndp, new IPEndPoint(dev.Address, 0), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RegisterNotification(Guid uuid, Uri descriptionUri, IPAddress address, IEnumerable<string> services)
|
public void RegisterNotification(string uuid, Uri descriptionUri, IPAddress address, IEnumerable<string> services)
|
||||||
{
|
{
|
||||||
var list = _devices.GetOrAdd(uuid, new List<UpnpDevice>());
|
var list = _devices.GetOrAdd(uuid, new List<UpnpDevice>());
|
||||||
|
|
||||||
@ -461,7 +461,7 @@ namespace MediaBrowser.Dlna.Ssdp
|
|||||||
_logger.Debug("Registered mount {0} at {1}", uuid, descriptionUri);
|
_logger.Debug("Registered mount {0} at {1}", uuid, descriptionUri);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UnregisterNotification(Guid uuid)
|
public void UnregisterNotification(string uuid)
|
||||||
{
|
{
|
||||||
List<UpnpDevice> dl;
|
List<UpnpDevice> dl;
|
||||||
if (_devices.TryRemove(uuid, out dl))
|
if (_devices.TryRemove(uuid, out dl))
|
||||||
|
@ -61,6 +61,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer
|
|||||||
if (!hasOptions.Options.ContainsKey("Server"))
|
if (!hasOptions.Options.ContainsKey("Server"))
|
||||||
{
|
{
|
||||||
hasOptions.Options["Server"] = "Mono-HTTPAPI/1.1, UPnP/1.0 DLNADOC/1.50";
|
hasOptions.Options["Server"] = "Mono-HTTPAPI/1.1, UPnP/1.0 DLNADOC/1.50";
|
||||||
|
//hasOptions.Options["Server"] = "Mono-HTTPAPI/1.1";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Content length has to be explicitly set on on HttpListenerResponse or it won't be happy
|
// Content length has to be explicitly set on on HttpListenerResponse or it won't be happy
|
||||||
|
Loading…
x
Reference in New Issue
Block a user