make more dlna attributes configurable

pull/702/head
Luke Pulverenti 10 years ago
parent 55461b7605
commit a9ccccc535

@ -482,7 +482,7 @@ namespace MediaBrowser.Dlna
var profile = GetProfile(headers) ?? var profile = GetProfile(headers) ??
GetDefaultProfile(); GetDefaultProfile();
return new DescriptionXmlBuilder(profile, serverUuId, serverAddress, _appHost.FriendlyName).GetXml(); return new DescriptionXmlBuilder(profile, serverUuId, serverAddress, _appHost.FriendlyName, serverUuId.GetMD5().ToString("N")).GetXml();
} }
public ImageStream GetIcon(string filename) public ImageStream GetIcon(string filename)

@ -13,7 +13,7 @@ namespace MediaBrowser.Dlna.PlayTo
public class SsdpHttpClient public class SsdpHttpClient
{ {
private const string USERAGENT = "Microsoft-Windows/6.2 UPnP/1.0 Microsoft-DLNA DLNADOC/1.50"; private const string USERAGENT = "Microsoft-Windows/6.2 UPnP/1.0 Microsoft-DLNA DLNADOC/1.50";
private const string FriendlyName = "MediaBrowser"; private const string FriendlyName = "Emby";
private readonly IHttpClient _httpClient; private readonly IHttpClient _httpClient;
private readonly IServerConfigurationManager _config; private readonly IServerConfigurationManager _config;

@ -1,4 +1,5 @@
using MediaBrowser.Model.Dlna; using MediaBrowser.Model.Dlna;
using System.Linq;
using System.Xml.Serialization; using System.Xml.Serialization;
namespace MediaBrowser.Dlna.Profiles namespace MediaBrowser.Dlna.Profiles
@ -75,6 +76,23 @@ namespace MediaBrowser.Dlna.Profiles
Type = DlnaProfileType.Video Type = DlnaProfileType.Video
} }
}; };
AddXmlRootAttribute("xmlns", "urn:schemas-upnp-org:device-1-0");
AddXmlRootAttribute("xmlns:dlna", "urn:schemas-dlna-org:device-1-0");
}
public void AddXmlRootAttribute(string name, string value)
{
var atts = XmlRootAttributes ?? new XmlAttribute[] { };
var list = atts.ToList();
list.Add(new XmlAttribute
{
Name = name,
Value = value
});
XmlRootAttributes = list.ToArray();
} }
} }
} }

@ -26,14 +26,7 @@ namespace MediaBrowser.Dlna.Profiles
} }
}; };
XmlRootAttributes = new[] AddXmlRootAttribute("xmlns:pv", "http://www.pv.com/pvns/");
{
new XmlAttribute
{
Name = "xmlns:pv",
Value = "http://www.pv.com/pvns/"
}
};
TimelineOffsetSeconds = 10; TimelineOffsetSeconds = 10;

@ -27,14 +27,7 @@ namespace MediaBrowser.Dlna.Profiles
} }
}; };
XmlRootAttributes = new[] AddXmlRootAttribute("xmlns:sec", "http://www.sec.co.kr/");
{
new XmlAttribute
{
Name = "xmlns:sec",
Value = "http://www.sec.co.kr/"
}
};
TranscodingProfiles = new[] TranscodingProfiles = new[]
{ {

@ -17,14 +17,7 @@ namespace MediaBrowser.Dlna.Profiles
ModelNumber = "BDP-2013" ModelNumber = "BDP-2013"
}; };
XmlRootAttributes = new[] AddXmlRootAttribute("xmlns:av", "urn:schemas-sony-com:av");
{
new XmlAttribute
{
Name = "xmlns:av",
Value = "urn:schemas-sony-com:av"
}
};
ModelName = "Windows Media Player Sharing"; ModelName = "Windows Media Player Sharing";
ModelNumber = "3.0"; ModelNumber = "3.0";

@ -33,14 +33,7 @@ namespace MediaBrowser.Dlna.Profiles
} }
}; };
XmlRootAttributes = new[] AddXmlRootAttribute("xmlns:av", "urn:schemas-sony-com:av");
{
new XmlAttribute
{
Name = "xmlns:av",
Value = "urn:schemas-sony-com:av"
}
};
ModelName = "Windows Media Player Sharing"; ModelName = "Windows Media Player Sharing";
ModelNumber = "3.0"; ModelNumber = "3.0";

@ -26,14 +26,7 @@ namespace MediaBrowser.Dlna.Profiles
} }
}; };
XmlRootAttributes = new[] AddXmlRootAttribute("xmlns:av", "urn:schemas-sony-com:av");
{
new XmlAttribute
{
Name = "xmlns:av",
Value = "urn:schemas-sony-com:av"
}
};
AlbumArtPn = "JPEG_TN"; AlbumArtPn = "JPEG_TN";

@ -26,14 +26,7 @@ namespace MediaBrowser.Dlna.Profiles
} }
}; };
XmlRootAttributes = new[] AddXmlRootAttribute("xmlns:av", "urn:schemas-sony-com:av");
{
new XmlAttribute
{
Name = "xmlns:av",
Value = "urn:schemas-sony-com:av"
}
};
AlbumArtPn = "JPEG_TN"; AlbumArtPn = "JPEG_TN";

@ -26,14 +26,7 @@ namespace MediaBrowser.Dlna.Profiles
} }
}; };
XmlRootAttributes = new[] AddXmlRootAttribute("xmlns:av", "urn:schemas-sony-com:av");
{
new XmlAttribute
{
Name = "xmlns:av",
Value = "urn:schemas-sony-com:av"
}
};
AlbumArtPn = "JPEG_TN"; AlbumArtPn = "JPEG_TN";

@ -26,14 +26,7 @@ namespace MediaBrowser.Dlna.Profiles
} }
}; };
XmlRootAttributes = new[] AddXmlRootAttribute("xmlns:av", "urn:schemas-sony-com:av");
{
new XmlAttribute
{
Name = "xmlns:av",
Value = "urn:schemas-sony-com:av"
}
};
AlbumArtPn = "JPEG_TN"; AlbumArtPn = "JPEG_TN";

@ -18,12 +18,13 @@ namespace MediaBrowser.Dlna.Profiles
ModelNumber = "12.0"; ModelNumber = "12.0";
FriendlyName = "${HostName} : 1"; FriendlyName = "${HostName}: Emby:";
ModelUrl = "http://www.microsoft.com/"; ModelUrl = "http://go.microsoft.com/fwlink/?LinkId=105926";
Manufacturer = "Microsoft Corporation"; Manufacturer = "Microsoft Corporation";
ManufacturerUrl = "http://www.microsoft.com/"; ManufacturerUrl = "http://www.microsoft.com";
XDlnaDoc = "DMS-1.50"; XDlnaDoc = "DMS-1.50";
ModelDescription = null;
TimelineOffsetSeconds = 40; TimelineOffsetSeconds = 40;
RequiresPlainFolders = true; RequiresPlainFolders = true;
@ -311,6 +312,9 @@ namespace MediaBrowser.Dlna.Profiles
} }
} }
}; };
XmlRootAttributes = new XmlAttribute[] { };
AddXmlRootAttribute("xmlns", "urn:schemas-upnp-org:device-1-0");
} }
} }
} }

@ -32,7 +32,10 @@
<RequiresPlainVideoItems>false</RequiresPlainVideoItems> <RequiresPlainVideoItems>false</RequiresPlainVideoItems>
<RequiresPlainFolders>false</RequiresPlainFolders> <RequiresPlainFolders>false</RequiresPlainFolders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar> <EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes /> <XmlRootAttributes>
<XmlAttribute name="xmlns" value="urn:schemas-upnp-org:device-1-0" />
<XmlAttribute name="xmlns:dlna" value="urn:schemas-dlna-org:device-1-0" />
</XmlRootAttributes>
<DirectPlayProfiles> <DirectPlayProfiles>
<DirectPlayProfile container="avi,mpeg,mkv,ts,mp4,mov,m4v,asf,webm,ogg,ogv,iso" type="Video" /> <DirectPlayProfile container="avi,mpeg,mkv,ts,mp4,mov,m4v,asf,webm,ogg,ogv,iso" type="Video" />
<DirectPlayProfile container="mp3,flac,asf,off,oga,aac" type="Audio" /> <DirectPlayProfile container="mp3,flac,asf,off,oga,aac" type="Audio" />

@ -26,7 +26,10 @@
<RequiresPlainVideoItems>false</RequiresPlainVideoItems> <RequiresPlainVideoItems>false</RequiresPlainVideoItems>
<RequiresPlainFolders>false</RequiresPlainFolders> <RequiresPlainFolders>false</RequiresPlainFolders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar> <EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes /> <XmlRootAttributes>
<XmlAttribute name="xmlns" value="urn:schemas-upnp-org:device-1-0" />
<XmlAttribute name="xmlns:dlna" value="urn:schemas-dlna-org:device-1-0" />
</XmlRootAttributes>
<DirectPlayProfiles> <DirectPlayProfiles>
<DirectPlayProfile container="mp3,wma" type="Audio" /> <DirectPlayProfile container="mp3,wma" type="Audio" />
<DirectPlayProfile container="avi,mp4" type="Video" /> <DirectPlayProfile container="avi,mp4" type="Video" />

@ -31,7 +31,10 @@
<RequiresPlainVideoItems>false</RequiresPlainVideoItems> <RequiresPlainVideoItems>false</RequiresPlainVideoItems>
<RequiresPlainFolders>false</RequiresPlainFolders> <RequiresPlainFolders>false</RequiresPlainFolders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar> <EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes /> <XmlRootAttributes>
<XmlAttribute name="xmlns" value="urn:schemas-upnp-org:device-1-0" />
<XmlAttribute name="xmlns:dlna" value="urn:schemas-dlna-org:device-1-0" />
</XmlRootAttributes>
<DirectPlayProfiles> <DirectPlayProfiles>
<DirectPlayProfile container="mp3,flac,m4a,wma" type="Audio" /> <DirectPlayProfile container="mp3,flac,m4a,wma" type="Audio" />
</DirectPlayProfiles> </DirectPlayProfiles>

@ -32,7 +32,10 @@
<RequiresPlainVideoItems>true</RequiresPlainVideoItems> <RequiresPlainVideoItems>true</RequiresPlainVideoItems>
<RequiresPlainFolders>true</RequiresPlainFolders> <RequiresPlainFolders>true</RequiresPlainFolders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar> <EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes /> <XmlRootAttributes>
<XmlAttribute name="xmlns" value="urn:schemas-upnp-org:device-1-0" />
<XmlAttribute name="xmlns:dlna" value="urn:schemas-dlna-org:device-1-0" />
</XmlRootAttributes>
<DirectPlayProfiles> <DirectPlayProfiles>
<DirectPlayProfile container="mpeg" audioCodec="mp2" videoCodec="mpeg2video" type="Video" /> <DirectPlayProfile container="mpeg" audioCodec="mp2" videoCodec="mpeg2video" type="Video" />
<DirectPlayProfile container="jpeg,jpg" type="Photo" /> <DirectPlayProfile container="jpeg,jpg" type="Photo" />

@ -33,7 +33,10 @@
<RequiresPlainVideoItems>false</RequiresPlainVideoItems> <RequiresPlainVideoItems>false</RequiresPlainVideoItems>
<RequiresPlainFolders>false</RequiresPlainFolders> <RequiresPlainFolders>false</RequiresPlainFolders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar> <EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes /> <XmlRootAttributes>
<XmlAttribute name="xmlns" value="urn:schemas-upnp-org:device-1-0" />
<XmlAttribute name="xmlns:dlna" value="urn:schemas-dlna-org:device-1-0" />
</XmlRootAttributes>
<DirectPlayProfiles> <DirectPlayProfiles>
<DirectPlayProfile container="mp4,mkv,mpeg,ts" audioCodec="mp3,ac3,aac,he-aac,pcm" videoCodec="h264,mpeg2video" type="Video" /> <DirectPlayProfile container="mp4,mkv,mpeg,ts" audioCodec="mp3,ac3,aac,he-aac,pcm" videoCodec="h264,mpeg2video" type="Video" />
<DirectPlayProfile container="mp3" audioCodec="mp3" type="Audio" /> <DirectPlayProfile container="mp3" audioCodec="mp3" type="Audio" />

@ -32,7 +32,10 @@
<RequiresPlainVideoItems>false</RequiresPlainVideoItems> <RequiresPlainVideoItems>false</RequiresPlainVideoItems>
<RequiresPlainFolders>false</RequiresPlainFolders> <RequiresPlainFolders>false</RequiresPlainFolders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar> <EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes /> <XmlRootAttributes>
<XmlAttribute name="xmlns" value="urn:schemas-upnp-org:device-1-0" />
<XmlAttribute name="xmlns:dlna" value="urn:schemas-dlna-org:device-1-0" />
</XmlRootAttributes>
<DirectPlayProfiles> <DirectPlayProfiles>
<DirectPlayProfile container="ts" audioCodec="aac,ac3,mp3" videoCodec="h264" type="Video" /> <DirectPlayProfile container="ts" audioCodec="aac,ac3,mp3" videoCodec="h264" type="Video" />
<DirectPlayProfile container="mkv" audioCodec="aac,ac3,mp3" videoCodec="h264" type="Video" /> <DirectPlayProfile container="mkv" audioCodec="aac,ac3,mp3" videoCodec="h264" type="Video" />

@ -30,7 +30,10 @@
<RequiresPlainVideoItems>false</RequiresPlainVideoItems> <RequiresPlainVideoItems>false</RequiresPlainVideoItems>
<RequiresPlainFolders>false</RequiresPlainFolders> <RequiresPlainFolders>false</RequiresPlainFolders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar> <EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes /> <XmlRootAttributes>
<XmlAttribute name="xmlns" value="urn:schemas-upnp-org:device-1-0" />
<XmlAttribute name="xmlns:dlna" value="urn:schemas-dlna-org:device-1-0" />
</XmlRootAttributes>
<DirectPlayProfiles> <DirectPlayProfiles>
<DirectPlayProfile container="mp3,flac,m4a,wma" type="Audio" /> <DirectPlayProfile container="mp3,flac,m4a,wma" type="Audio" />
<DirectPlayProfile container="avi,mp4,mkv,ts" type="Video" /> <DirectPlayProfile container="avi,mp4,mkv,ts" type="Video" />

@ -32,7 +32,10 @@
<RequiresPlainVideoItems>false</RequiresPlainVideoItems> <RequiresPlainVideoItems>false</RequiresPlainVideoItems>
<RequiresPlainFolders>false</RequiresPlainFolders> <RequiresPlainFolders>false</RequiresPlainFolders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar> <EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes /> <XmlRootAttributes>
<XmlAttribute name="xmlns" value="urn:schemas-upnp-org:device-1-0" />
<XmlAttribute name="xmlns:dlna" value="urn:schemas-dlna-org:device-1-0" />
</XmlRootAttributes>
<DirectPlayProfiles> <DirectPlayProfiles>
<DirectPlayProfile container="mp3" audioCodec="mp2,mp3" type="Audio" /> <DirectPlayProfile container="mp3" audioCodec="mp2,mp3" type="Audio" />
<DirectPlayProfile container="mp4" audioCodec="mp4" type="Audio" /> <DirectPlayProfile container="mp4" audioCodec="mp4" type="Audio" />

@ -34,6 +34,8 @@
<RequiresPlainFolders>false</RequiresPlainFolders> <RequiresPlainFolders>false</RequiresPlainFolders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar> <EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes> <XmlRootAttributes>
<XmlAttribute name="xmlns" value="urn:schemas-upnp-org:device-1-0" />
<XmlAttribute name="xmlns:dlna" value="urn:schemas-dlna-org:device-1-0" />
<XmlAttribute name="xmlns:pv" value="http://www.pv.com/pvns/" /> <XmlAttribute name="xmlns:pv" value="http://www.pv.com/pvns/" />
</XmlRootAttributes> </XmlRootAttributes>
<DirectPlayProfiles> <DirectPlayProfiles>

@ -26,7 +26,10 @@
<RequiresPlainVideoItems>false</RequiresPlainVideoItems> <RequiresPlainVideoItems>false</RequiresPlainVideoItems>
<RequiresPlainFolders>false</RequiresPlainFolders> <RequiresPlainFolders>false</RequiresPlainFolders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar> <EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes /> <XmlRootAttributes>
<XmlAttribute name="xmlns" value="urn:schemas-upnp-org:device-1-0" />
<XmlAttribute name="xmlns:dlna" value="urn:schemas-dlna-org:device-1-0" />
</XmlRootAttributes>
<DirectPlayProfiles> <DirectPlayProfiles>
<DirectPlayProfile container="mp4,mov" audioCodec="aac" videoCodec="h264,mpeg4" type="Video" /> <DirectPlayProfile container="mp4,mov" audioCodec="aac" videoCodec="h264,mpeg4" type="Video" />
<DirectPlayProfile container="ts" audioCodec="aac,ac3,eac3,mp3,mp2,pcm" videoCodec="h264" type="Video" /> <DirectPlayProfile container="ts" audioCodec="aac,ac3,eac3,mp3,mp2,pcm" videoCodec="h264" type="Video" />

@ -33,6 +33,8 @@
<RequiresPlainFolders>false</RequiresPlainFolders> <RequiresPlainFolders>false</RequiresPlainFolders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar> <EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes> <XmlRootAttributes>
<XmlAttribute name="xmlns" value="urn:schemas-upnp-org:device-1-0" />
<XmlAttribute name="xmlns:dlna" value="urn:schemas-dlna-org:device-1-0" />
<XmlAttribute name="xmlns:sec" value="http://www.sec.co.kr/" /> <XmlAttribute name="xmlns:sec" value="http://www.sec.co.kr/" />
</XmlRootAttributes> </XmlRootAttributes>
<DirectPlayProfiles> <DirectPlayProfiles>

@ -33,6 +33,8 @@
<RequiresPlainFolders>false</RequiresPlainFolders> <RequiresPlainFolders>false</RequiresPlainFolders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar> <EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes> <XmlRootAttributes>
<XmlAttribute name="xmlns" value="urn:schemas-upnp-org:device-1-0" />
<XmlAttribute name="xmlns:dlna" value="urn:schemas-dlna-org:device-1-0" />
<XmlAttribute name="xmlns:av" value="urn:schemas-sony-com:av" /> <XmlAttribute name="xmlns:av" value="urn:schemas-sony-com:av" />
</XmlRootAttributes> </XmlRootAttributes>
<DirectPlayProfiles> <DirectPlayProfiles>

@ -35,6 +35,8 @@
<RequiresPlainFolders>false</RequiresPlainFolders> <RequiresPlainFolders>false</RequiresPlainFolders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar> <EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes> <XmlRootAttributes>
<XmlAttribute name="xmlns" value="urn:schemas-upnp-org:device-1-0" />
<XmlAttribute name="xmlns:dlna" value="urn:schemas-dlna-org:device-1-0" />
<XmlAttribute name="xmlns:av" value="urn:schemas-sony-com:av" /> <XmlAttribute name="xmlns:av" value="urn:schemas-sony-com:av" />
</XmlRootAttributes> </XmlRootAttributes>
<DirectPlayProfiles> <DirectPlayProfiles>

@ -35,6 +35,8 @@
<RequiresPlainFolders>false</RequiresPlainFolders> <RequiresPlainFolders>false</RequiresPlainFolders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar> <EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes> <XmlRootAttributes>
<XmlAttribute name="xmlns" value="urn:schemas-upnp-org:device-1-0" />
<XmlAttribute name="xmlns:dlna" value="urn:schemas-dlna-org:device-1-0" />
<XmlAttribute name="xmlns:av" value="urn:schemas-sony-com:av" /> <XmlAttribute name="xmlns:av" value="urn:schemas-sony-com:av" />
</XmlRootAttributes> </XmlRootAttributes>
<DirectPlayProfiles> <DirectPlayProfiles>

@ -35,6 +35,8 @@
<RequiresPlainFolders>false</RequiresPlainFolders> <RequiresPlainFolders>false</RequiresPlainFolders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar> <EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes> <XmlRootAttributes>
<XmlAttribute name="xmlns" value="urn:schemas-upnp-org:device-1-0" />
<XmlAttribute name="xmlns:dlna" value="urn:schemas-dlna-org:device-1-0" />
<XmlAttribute name="xmlns:av" value="urn:schemas-sony-com:av" /> <XmlAttribute name="xmlns:av" value="urn:schemas-sony-com:av" />
</XmlRootAttributes> </XmlRootAttributes>
<DirectPlayProfiles> <DirectPlayProfiles>

@ -35,6 +35,8 @@
<RequiresPlainFolders>false</RequiresPlainFolders> <RequiresPlainFolders>false</RequiresPlainFolders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar> <EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes> <XmlRootAttributes>
<XmlAttribute name="xmlns" value="urn:schemas-upnp-org:device-1-0" />
<XmlAttribute name="xmlns:dlna" value="urn:schemas-dlna-org:device-1-0" />
<XmlAttribute name="xmlns:av" value="urn:schemas-sony-com:av" /> <XmlAttribute name="xmlns:av" value="urn:schemas-sony-com:av" />
</XmlRootAttributes> </XmlRootAttributes>
<DirectPlayProfiles> <DirectPlayProfiles>

@ -35,6 +35,8 @@
<RequiresPlainFolders>false</RequiresPlainFolders> <RequiresPlainFolders>false</RequiresPlainFolders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar> <EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes> <XmlRootAttributes>
<XmlAttribute name="xmlns" value="urn:schemas-upnp-org:device-1-0" />
<XmlAttribute name="xmlns:dlna" value="urn:schemas-dlna-org:device-1-0" />
<XmlAttribute name="xmlns:av" value="urn:schemas-sony-com:av" /> <XmlAttribute name="xmlns:av" value="urn:schemas-sony-com:av" />
</XmlRootAttributes> </XmlRootAttributes>
<DirectPlayProfiles> <DirectPlayProfiles>

@ -34,7 +34,10 @@
<RequiresPlainVideoItems>false</RequiresPlainVideoItems> <RequiresPlainVideoItems>false</RequiresPlainVideoItems>
<RequiresPlainFolders>false</RequiresPlainFolders> <RequiresPlainFolders>false</RequiresPlainFolders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar> <EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes /> <XmlRootAttributes>
<XmlAttribute name="xmlns" value="urn:schemas-upnp-org:device-1-0" />
<XmlAttribute name="xmlns:dlna" value="urn:schemas-dlna-org:device-1-0" />
</XmlRootAttributes>
<DirectPlayProfiles> <DirectPlayProfiles>
<DirectPlayProfile container="avi" audioCodec="mp2,mp3" videoCodec="mpeg4" type="Video" /> <DirectPlayProfile container="avi" audioCodec="mp2,mp3" videoCodec="mpeg4" type="Video" />
<DirectPlayProfile container="ts" audioCodec="ac3,mp2,mp3,aac" videoCodec="mpeg1video,mpeg2video,h264" type="Video" /> <DirectPlayProfile container="ts" audioCodec="ac3,mp2,mp3,aac" videoCodec="mpeg1video,mpeg2video,h264" type="Video" />

@ -32,7 +32,10 @@
<RequiresPlainVideoItems>false</RequiresPlainVideoItems> <RequiresPlainVideoItems>false</RequiresPlainVideoItems>
<RequiresPlainFolders>false</RequiresPlainFolders> <RequiresPlainFolders>false</RequiresPlainFolders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar> <EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes /> <XmlRootAttributes>
<XmlAttribute name="xmlns" value="urn:schemas-upnp-org:device-1-0" />
<XmlAttribute name="xmlns:dlna" value="urn:schemas-dlna-org:device-1-0" />
</XmlRootAttributes>
<DirectPlayProfiles> <DirectPlayProfiles>
<DirectPlayProfile container="avi,mpeg,mkv,ts,mp4,mov,m4v,asf,webm,ogg,ogv,iso" type="Video" /> <DirectPlayProfile container="avi,mpeg,mkv,ts,mp4,mov,m4v,asf,webm,ogg,ogv,iso" type="Video" />
<DirectPlayProfile container="mp3,flac,asf,off,oga,aac" type="Audio" /> <DirectPlayProfile container="mp3,flac,asf,off,oga,aac" type="Audio" />

@ -33,7 +33,10 @@
<RequiresPlainVideoItems>false</RequiresPlainVideoItems> <RequiresPlainVideoItems>false</RequiresPlainVideoItems>
<RequiresPlainFolders>false</RequiresPlainFolders> <RequiresPlainFolders>false</RequiresPlainFolders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar> <EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes /> <XmlRootAttributes>
<XmlAttribute name="xmlns" value="urn:schemas-upnp-org:device-1-0" />
<XmlAttribute name="xmlns:dlna" value="urn:schemas-dlna-org:device-1-0" />
</XmlRootAttributes>
<DirectPlayProfiles> <DirectPlayProfiles>
<DirectPlayProfile container="avi" audioCodec="ac3,dca,mp2,mp3,pcm" videoCodec="mpeg1video,mpeg2video,mpeg4,h264,vc1" type="Video" /> <DirectPlayProfile container="avi" audioCodec="ac3,dca,mp2,mp3,pcm" videoCodec="mpeg1video,mpeg2video,mpeg4,h264,vc1" type="Video" />
<DirectPlayProfile container="mpeg" audioCodec="ac3,dca,mp2,mp3,pcm" videoCodec="mpeg1video,mpeg2video" type="Video" /> <DirectPlayProfile container="mpeg" audioCodec="ac3,dca,mp2,mp3,pcm" videoCodec="mpeg1video,mpeg2video" type="Video" />

@ -8,13 +8,12 @@
<HttpHeaderInfo name="User-Agent" value="Xenon" match="Substring" /> <HttpHeaderInfo name="User-Agent" value="Xenon" match="Substring" />
</Headers> </Headers>
</Identification> </Identification>
<FriendlyName>${HostName} : 1</FriendlyName> <FriendlyName>${HostName}: Emby:</FriendlyName>
<Manufacturer>Microsoft Corporation</Manufacturer> <Manufacturer>Microsoft Corporation</Manufacturer>
<ManufacturerUrl>http://www.microsoft.com/</ManufacturerUrl> <ManufacturerUrl>http://www.microsoft.com</ManufacturerUrl>
<ModelName>Windows Media Player Sharing</ModelName> <ModelName>Windows Media Player Sharing</ModelName>
<ModelDescription>Emby</ModelDescription>
<ModelNumber>12.0</ModelNumber> <ModelNumber>12.0</ModelNumber>
<ModelUrl>http://www.microsoft.com/</ModelUrl> <ModelUrl>http://go.microsoft.com/fwlink/?LinkId=105926</ModelUrl>
<EnableAlbumArtInDidl>false</EnableAlbumArtInDidl> <EnableAlbumArtInDidl>false</EnableAlbumArtInDidl>
<EnableSingleAlbumArtLimit>false</EnableSingleAlbumArtLimit> <EnableSingleAlbumArtLimit>false</EnableSingleAlbumArtLimit>
<SupportedMediaTypes>Audio,Photo,Video</SupportedMediaTypes> <SupportedMediaTypes>Audio,Photo,Video</SupportedMediaTypes>
@ -33,7 +32,9 @@
<RequiresPlainVideoItems>true</RequiresPlainVideoItems> <RequiresPlainVideoItems>true</RequiresPlainVideoItems>
<RequiresPlainFolders>true</RequiresPlainFolders> <RequiresPlainFolders>true</RequiresPlainFolders>
<EnableMSMediaReceiverRegistrar>true</EnableMSMediaReceiverRegistrar> <EnableMSMediaReceiverRegistrar>true</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes /> <XmlRootAttributes>
<XmlAttribute name="xmlns" value="urn:schemas-upnp-org:device-1-0" />
</XmlRootAttributes>
<DirectPlayProfiles> <DirectPlayProfiles>
<DirectPlayProfile container="avi" audioCodec="ac3,mp3" videoCodec="mpeg4" type="Video" /> <DirectPlayProfile container="avi" audioCodec="ac3,mp3" videoCodec="mpeg4" type="Video" />
<DirectPlayProfile container="avi" audioCodec="aac" videoCodec="h264" type="Video" /> <DirectPlayProfile container="avi" audioCodec="aac" videoCodec="h264" type="Video" />

@ -33,7 +33,10 @@
<RequiresPlainVideoItems>false</RequiresPlainVideoItems> <RequiresPlainVideoItems>false</RequiresPlainVideoItems>
<RequiresPlainFolders>false</RequiresPlainFolders> <RequiresPlainFolders>false</RequiresPlainFolders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar> <EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes /> <XmlRootAttributes>
<XmlAttribute name="xmlns" value="urn:schemas-upnp-org:device-1-0" />
<XmlAttribute name="xmlns:dlna" value="urn:schemas-dlna-org:device-1-0" />
</XmlRootAttributes>
<DirectPlayProfiles> <DirectPlayProfiles>
<DirectPlayProfile container="ts" audioCodec="ac3" videoCodec="h264" type="Video" /> <DirectPlayProfile container="ts" audioCodec="ac3" videoCodec="h264" type="Video" />
<DirectPlayProfile container="avi" audioCodec="ac3,mp3" videoCodec="mpeg4" type="Video" /> <DirectPlayProfile container="avi" audioCodec="ac3,mp3" videoCodec="mpeg4" type="Video" />

@ -32,7 +32,10 @@
<RequiresPlainVideoItems>false</RequiresPlainVideoItems> <RequiresPlainVideoItems>false</RequiresPlainVideoItems>
<RequiresPlainFolders>false</RequiresPlainFolders> <RequiresPlainFolders>false</RequiresPlainFolders>
<EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar> <EnableMSMediaReceiverRegistrar>false</EnableMSMediaReceiverRegistrar>
<XmlRootAttributes /> <XmlRootAttributes>
<XmlAttribute name="xmlns" value="urn:schemas-upnp-org:device-1-0" />
<XmlAttribute name="xmlns:dlna" value="urn:schemas-dlna-org:device-1-0" />
</XmlRootAttributes>
<DirectPlayProfiles> <DirectPlayProfiles>
<DirectPlayProfile container="mp3" audioCodec="mp2,mp3" type="Audio" /> <DirectPlayProfile container="mp3" audioCodec="mp2,mp3" type="Audio" />
<DirectPlayProfile container="mp4" audioCodec="mp4" type="Audio" /> <DirectPlayProfile container="mp4" audioCodec="mp4" type="Audio" />

@ -18,8 +18,9 @@ namespace MediaBrowser.Dlna.Server
private readonly string _serverUdn; private readonly string _serverUdn;
private readonly string _serverAddress; private readonly string _serverAddress;
private readonly string _serverName; private readonly string _serverName;
private readonly string _serverId;
public DescriptionXmlBuilder(DeviceProfile profile, string serverUdn, string serverAddress, string serverName) public DescriptionXmlBuilder(DeviceProfile profile, string serverUdn, string serverAddress, string serverName, string serverId)
{ {
if (string.IsNullOrWhiteSpace(serverUdn)) if (string.IsNullOrWhiteSpace(serverUdn))
{ {
@ -35,6 +36,7 @@ namespace MediaBrowser.Dlna.Server
_serverUdn = serverUdn; _serverUdn = serverUdn;
_serverAddress = serverAddress; _serverAddress = serverAddress;
_serverName = serverName; _serverName = serverName;
_serverId = serverId;
} }
private bool EnableAbsoluteUrls private bool EnableAbsoluteUrls
@ -48,7 +50,7 @@ namespace MediaBrowser.Dlna.Server
builder.Append("<?xml version=\"1.0\"?>"); builder.Append("<?xml version=\"1.0\"?>");
builder.Append("<root xmlns=\"urn:schemas-upnp-org:device-1-0\" xmlns:dlna=\"urn:schemas-dlna-org:device-1-0\""); builder.Append("<root");
foreach (var att in _profile.XmlRootAttributes) foreach (var att in _profile.XmlRootAttributes)
{ {
builder.AppendFormat(" {0}=\"{1}\"", att.Name, att.Value); builder.AppendFormat(" {0}=\"{1}\"", att.Name, att.Value);
@ -72,7 +74,7 @@ namespace MediaBrowser.Dlna.Server
builder.Append("<device>"); builder.Append("<device>");
AppendDeviceProperties(builder); AppendDeviceProperties(builder);
AppendIconList(builder); //AppendIconList(builder);
AppendServiceList(builder); AppendServiceList(builder);
builder.Append("</device>"); builder.Append("</device>");
} }
@ -80,7 +82,11 @@ namespace MediaBrowser.Dlna.Server
private void AppendDeviceProperties(StringBuilder builder) private void AppendDeviceProperties(StringBuilder builder)
{ {
builder.Append("<UDN>uuid:" + SecurityElement.Escape(_serverUdn) + "</UDN>"); builder.Append("<UDN>uuid:" + SecurityElement.Escape(_serverUdn) + "</UDN>");
builder.Append("<dlna:X_DLNACAP>" + SecurityElement.Escape(_profile.XDlnaCap ?? string.Empty) + "</dlna:X_DLNACAP>");
if (!string.IsNullOrWhiteSpace(_profile.XDlnaCap))
{
builder.Append("<dlna:X_DLNACAP>" + SecurityElement.Escape(_profile.XDlnaCap ?? string.Empty) + "</dlna:X_DLNACAP>");
}
builder.Append("<dlna:X_DLNADOC xmlns:dlna=\"urn:schemas-dlna-org:device-1-0\">M-DMS-1.50</dlna:X_DLNADOC>"); builder.Append("<dlna:X_DLNADOC xmlns:dlna=\"urn:schemas-dlna-org:device-1-0\">M-DMS-1.50</dlna:X_DLNADOC>");
builder.Append("<dlna:X_DLNADOC xmlns:dlna=\"urn:schemas-dlna-org:device-1-0\">" + SecurityElement.Escape(_profile.XDlnaDoc ?? string.Empty) + "</dlna:X_DLNADOC>"); builder.Append("<dlna:X_DLNADOC xmlns:dlna=\"urn:schemas-dlna-org:device-1-0\">" + SecurityElement.Escape(_profile.XDlnaDoc ?? string.Empty) + "</dlna:X_DLNADOC>");
@ -90,10 +96,23 @@ namespace MediaBrowser.Dlna.Server
builder.Append("<manufacturer>" + SecurityElement.Escape(_profile.Manufacturer ?? string.Empty) + "</manufacturer>"); builder.Append("<manufacturer>" + SecurityElement.Escape(_profile.Manufacturer ?? string.Empty) + "</manufacturer>");
builder.Append("<manufacturerURL>" + SecurityElement.Escape(_profile.ManufacturerUrl ?? string.Empty) + "</manufacturerURL>"); builder.Append("<manufacturerURL>" + SecurityElement.Escape(_profile.ManufacturerUrl ?? string.Empty) + "</manufacturerURL>");
builder.Append("<modelName>" + SecurityElement.Escape(_profile.ModelName ?? string.Empty) + "</modelName>"); builder.Append("<modelName>" + SecurityElement.Escape(_profile.ModelName ?? string.Empty) + "</modelName>");
builder.Append("<modelDescription>" + SecurityElement.Escape(_profile.ModelDescription ?? string.Empty) + "</modelDescription>");
if (!string.IsNullOrWhiteSpace(_profile.ModelDescription))
{
builder.Append("<modelDescription>" + SecurityElement.Escape(_profile.ModelDescription ?? string.Empty) + "</modelDescription>");
}
builder.Append("<modelNumber>" + SecurityElement.Escape(_profile.ModelNumber ?? string.Empty) + "</modelNumber>"); builder.Append("<modelNumber>" + SecurityElement.Escape(_profile.ModelNumber ?? string.Empty) + "</modelNumber>");
builder.Append("<modelURL>" + SecurityElement.Escape(_profile.ModelUrl ?? string.Empty) + "</modelURL>"); builder.Append("<modelURL>" + SecurityElement.Escape(_profile.ModelUrl ?? string.Empty) + "</modelURL>");
builder.Append("<serialNumber>" + SecurityElement.Escape(_profile.SerialNumber ?? string.Empty) + "</serialNumber>");
if (string.IsNullOrWhiteSpace(_profile.SerialNumber))
{
builder.Append("<serialNumber>" + SecurityElement.Escape(_serverId) + "</serialNumber>");
}
else
{
builder.Append("<serialNumber>" + SecurityElement.Escape(_profile.SerialNumber) + "</serialNumber>");
}
builder.Append("<presentationURL>" + SecurityElement.Escape(_serverAddress) + "</presentationURL>"); builder.Append("<presentationURL>" + SecurityElement.Escape(_serverAddress) + "</presentationURL>");

@ -14,6 +14,15 @@ namespace MediaBrowser.Providers.Manager
bool replaceData, bool replaceData,
bool mergeMetadataSettings) bool mergeMetadataSettings)
{ {
if (source == null)
{
throw new ArgumentNullException("source");
}
if (target == null)
{
throw new ArgumentNullException("target");
}
if (!lockedFields.Contains(MetadataFields.Name)) if (!lockedFields.Contains(MetadataFields.Name))
{ {
if (replaceData || string.IsNullOrEmpty(target.Name)) if (replaceData || string.IsNullOrEmpty(target.Name))

Loading…
Cancel
Save