update xbox one profile

This commit is contained in:
Luke Pulverenti 2015-05-07 18:27:01 -04:00
parent 63dc2512c5
commit 55461b7605
6 changed files with 61 additions and 35 deletions

View File

@ -1086,6 +1086,10 @@ namespace MediaBrowser.Api.Playback
}
}
}
catch (ObjectDisposedException)
{
// Don't spam the log. This doesn't seem to throw in windows, but sometimes under linux
}
catch (Exception ex)
{
Logger.ErrorException("Error reading ffmpeg log", ex);

View File

@ -14,7 +14,7 @@ namespace MediaBrowser.Dlna.Profiles
Identification = new DeviceIdentification
{
FriendlyName = "XboxOne",
ModelName = "Xbox One",
Headers = new[]
{

View File

@ -2,7 +2,7 @@
<Profile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Name>Xbox One</Name>
<Identification>
<FriendlyName>XboxOne</FriendlyName>
<ModelName>Xbox One</ModelName>
<Headers>
<HttpHeaderInfo name="FriendlyName.DLNA.ORG" value="XboxOne" match="Substring" />
<HttpHeaderInfo name="User-Agent" value="NSPlayer/12" match="Substring" />

View File

@ -29,32 +29,43 @@ namespace MediaBrowser.Dlna.Ssdp
public void Send()
{
var msg = Encoding.ASCII.GetBytes(Message);
try
{
var client = CreateSocket();
if (FromEndPoint != null)
var socket = CreateSocket();
if (socket == null)
{
return;
}
if (FromEndPoint != null)
{
try
{
try
socket.Bind(FromEndPoint);
}
catch (Exception ex)
{
if (EnableDebugLogging)
{
client.Bind(FromEndPoint);
_logger.ErrorException("Error binding datagram socket", ex);
}
catch (Exception ex)
if (!IgnoreBindFailure)
{
if (EnableDebugLogging)
{
_logger.ErrorException("Error binding datagram socket", ex);
}
if (!IgnoreBindFailure) throw;
CloseSocket(socket, false);
return;
}
}
}
client.BeginSendTo(msg, 0, msg.Length, SocketFlags.None, ToEndPoint, result =>
try
{
socket.BeginSendTo(msg, 0, msg.Length, SocketFlags.None, ToEndPoint, result =>
{
try
{
client.EndSend(result);
socket.EndSend(result);
}
catch (Exception ex)
{
@ -65,32 +76,46 @@ namespace MediaBrowser.Dlna.Ssdp
}
finally
{
try
{
client.Close();
}
catch (Exception ex)
{
if (EnableDebugLogging)
{
_logger.ErrorException("Error closing datagram socket", ex);
}
}
CloseSocket(socket, true);
}
}, null);
}
catch (Exception ex)
{
_logger.ErrorException("Error sending Datagram to {0} from {1}: " + Message, ex, ToEndPoint, FromEndPoint == null ? "" : FromEndPoint.ToString());
CloseSocket(socket, false);
}
}
private void CloseSocket(Socket socket, bool logError)
{
try
{
socket.Close();
}
catch (Exception ex)
{
if (logError && EnableDebugLogging)
{
_logger.ErrorException("Error closing datagram socket", ex);
}
}
}
private Socket CreateSocket()
{
var socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
try
{
var socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
return socket;
socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
return socket;
}
catch (Exception ex)
{
_logger.ErrorException("Error creating socket", ex);
return null;
}
}
}
}

View File

@ -281,7 +281,7 @@ namespace MediaBrowser.WebDashboard.Api
await AppendResource(memoryStream, "thirdparty/jstree3.0.8/jstree.js", newLineBytes).ConfigureAwait(false);
await AppendResource(memoryStream, "thirdparty/fastclick.js", newLineBytes).ConfigureAwait(false);
//await AppendResource(memoryStream, "thirdparty/fastclick.js", newLineBytes).ConfigureAwait(false);
await AppendResource(memoryStream, "thirdparty/headroom.js", newLineBytes).ConfigureAwait(false);
await AppendLocalization(memoryStream, culture).ConfigureAwait(false);

View File

@ -363,9 +363,6 @@
<Content Include="dashboard-ui\css\images\icons\volumeup.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\css\images\icons\wireless.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\css\images\items\detail\tv.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>