updated nuget
This commit is contained in:
parent
60d1d5cdee
commit
5de8b92fe5
|
@ -123,7 +123,6 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
|
|||
}
|
||||
|
||||
request.Method = method;
|
||||
request.Pipelined = true;
|
||||
request.Timeout = 20000;
|
||||
|
||||
if (!string.IsNullOrEmpty(options.Host))
|
||||
|
|
|
@ -349,6 +349,7 @@ namespace MediaBrowser.Providers.Movies
|
|||
|
||||
if (diff > 0)
|
||||
{
|
||||
_logger.Debug("Throttling MovieDb by {0} ms", diff);
|
||||
await Task.Delay(Convert.ToInt32(diff), cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ using MediaBrowser.Common.Net;
|
|||
using MediaBrowser.Controller.Entities.Audio;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.Providers;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
@ -22,11 +23,13 @@ namespace MediaBrowser.Providers.Music
|
|||
|
||||
private readonly IHttpClient _httpClient;
|
||||
private readonly IApplicationHost _appHost;
|
||||
private readonly ILogger _logger;
|
||||
|
||||
public MusicBrainzAlbumProvider(IHttpClient httpClient, IApplicationHost appHost)
|
||||
public MusicBrainzAlbumProvider(IHttpClient httpClient, IApplicationHost appHost, ILogger logger)
|
||||
{
|
||||
_httpClient = httpClient;
|
||||
_appHost = appHost;
|
||||
_logger = logger;
|
||||
Current = this;
|
||||
}
|
||||
|
||||
|
@ -285,11 +288,10 @@ namespace MediaBrowser.Providers.Music
|
|||
|
||||
if (diff > 0)
|
||||
{
|
||||
_logger.Debug("Throttling musicbrainz by {0} ms", diff);
|
||||
await Task.Delay(Convert.ToInt32(diff), cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
_lastRequestDate = DateTime.Now;
|
||||
|
||||
var doc = new XmlDocument();
|
||||
|
||||
var userAgent = _appHost.Name + "/" + _appHost.ApplicationVersion;
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
using MediaBrowser.Common.Configuration;
|
||||
using System.Net;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Controller;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Controller.Connect;
|
||||
using MediaBrowser.Controller.Security;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.Net;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
@ -93,11 +95,26 @@ namespace MediaBrowser.Server.Implementations.Connect
|
|||
var hasExistingRecord = !string.IsNullOrWhiteSpace(ConnectServerId) &&
|
||||
!string.IsNullOrWhiteSpace(ConnectAccessKey);
|
||||
|
||||
var createNewRegistration = !hasExistingRecord;
|
||||
|
||||
if (hasExistingRecord)
|
||||
{
|
||||
await UpdateServerRegistration(wanApiAddress).ConfigureAwait(false);
|
||||
try
|
||||
{
|
||||
await UpdateServerRegistration(wanApiAddress).ConfigureAwait(false);
|
||||
}
|
||||
catch (HttpException ex)
|
||||
{
|
||||
if (!ex.StatusCode.HasValue || ex.StatusCode.Value != HttpStatusCode.NotFound || ex.StatusCode.Value != HttpStatusCode.Unauthorized)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
|
||||
createNewRegistration = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
if (createNewRegistration)
|
||||
{
|
||||
await CreateServerRegistration(wanApiAddress).ConfigureAwait(false);
|
||||
}
|
||||
|
@ -136,7 +153,6 @@ namespace MediaBrowser.Server.Implementations.Connect
|
|||
url = GetConnectUrl(url);
|
||||
url += "?id=" + ConnectServerId;
|
||||
|
||||
// TODO: Add Access-Key http request header
|
||||
var options = new HttpRequestOptions
|
||||
{
|
||||
Url = url,
|
||||
|
|
|
@ -168,7 +168,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer
|
|||
|
||||
_listener = NativeWebSocket.IsSupported
|
||||
? _listener = new HttpListenerServer(_logger, OnRequestReceived)
|
||||
//? _listener = new WebSocketSharpListener(_logger)
|
||||
//? _listener = new WebSocketSharpListener(_logger, OnRequestReceived)
|
||||
: _listener = new WebSocketSharpListener(_logger, OnRequestReceived);
|
||||
|
||||
_listener.WebSocketHandler = WebSocketHandler;
|
||||
|
|
|
@ -0,0 +1,50 @@
|
|||
using MediaBrowser.Model.Logging;
|
||||
using System;
|
||||
|
||||
namespace MediaBrowser.Server.Implementations.HttpServer.SocketSharp
|
||||
{
|
||||
public class SocketSharpLogger : WebSocketSharp.Logging.ILogger
|
||||
{
|
||||
private readonly ILogger _logger;
|
||||
|
||||
public SocketSharpLogger(ILogger logger)
|
||||
{
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
public void Debug(string message, params object[] paramList)
|
||||
{
|
||||
_logger.Debug(message, paramList);
|
||||
}
|
||||
|
||||
public void Error(string message, params object[] paramList)
|
||||
{
|
||||
_logger.Error(message, paramList);
|
||||
}
|
||||
|
||||
public void ErrorException(string message, Exception exception, params object[] paramList)
|
||||
{
|
||||
_logger.ErrorException(message, exception, paramList);
|
||||
}
|
||||
|
||||
public void Fatal(string message, params object[] paramList)
|
||||
{
|
||||
_logger.Fatal(message, paramList);
|
||||
}
|
||||
|
||||
public void FatalException(string message, Exception exception, params object[] paramList)
|
||||
{
|
||||
_logger.FatalException(message, exception, paramList);
|
||||
}
|
||||
|
||||
public void Info(string message, params object[] paramList)
|
||||
{
|
||||
_logger.Info(message, paramList);
|
||||
}
|
||||
|
||||
public void Warn(string message, params object[] paramList)
|
||||
{
|
||||
_logger.Warn(message, paramList);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -35,7 +35,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer.SocketSharp
|
|||
public void Start(IEnumerable<string> urlPrefixes)
|
||||
{
|
||||
if (_listener == null)
|
||||
_listener = new WebSocketSharp.Net.HttpListener();
|
||||
_listener = new HttpListener(new SocketSharpLogger(_logger));
|
||||
|
||||
foreach (var prefix in urlPrefixes)
|
||||
{
|
||||
|
|
|
@ -162,6 +162,7 @@
|
|||
<Compile Include="HttpServer\ServerLogger.cs" />
|
||||
<Compile Include="HttpServer\Security\SessionContext.cs" />
|
||||
<Compile Include="HttpServer\SocketSharp\SharpWebSocket.cs" />
|
||||
<Compile Include="HttpServer\SocketSharp\SocketSharpLogger.cs" />
|
||||
<Compile Include="HttpServer\StreamWriter.cs" />
|
||||
<Compile Include="HttpServer\SwaggerService.cs" />
|
||||
<Compile Include="Drawing\ImageProcessor.cs" />
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>MediaBrowser.Common.Internal</id>
|
||||
<version>3.0.429</version>
|
||||
<version>3.0.430</version>
|
||||
<title>MediaBrowser.Common.Internal</title>
|
||||
<authors>Luke</authors>
|
||||
<owners>ebr,Luke,scottisafool</owners>
|
||||
|
@ -12,7 +12,7 @@
|
|||
<description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description>
|
||||
<copyright>Copyright © Media Browser 2013</copyright>
|
||||
<dependencies>
|
||||
<dependency id="MediaBrowser.Common" version="3.0.429" />
|
||||
<dependency id="MediaBrowser.Common" version="3.0.430" />
|
||||
<dependency id="NLog" version="3.1.0.0" />
|
||||
<dependency id="SimpleInjector" version="2.5.2" />
|
||||
<dependency id="sharpcompress" version="0.10.2" />
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>MediaBrowser.Common</id>
|
||||
<version>3.0.429</version>
|
||||
<version>3.0.430</version>
|
||||
<title>MediaBrowser.Common</title>
|
||||
<authors>Media Browser Team</authors>
|
||||
<owners>ebr,Luke,scottisafool</owners>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>MediaBrowser.Model.Signed</id>
|
||||
<version>3.0.429</version>
|
||||
<version>3.0.430</version>
|
||||
<title>MediaBrowser.Model - Signed Edition</title>
|
||||
<authors>Media Browser Team</authors>
|
||||
<owners>ebr,Luke,scottisafool</owners>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>MediaBrowser.Server.Core</id>
|
||||
<version>3.0.429</version>
|
||||
<version>3.0.430</version>
|
||||
<title>Media Browser.Server.Core</title>
|
||||
<authors>Media Browser Team</authors>
|
||||
<owners>ebr,Luke,scottisafool</owners>
|
||||
|
@ -12,7 +12,7 @@
|
|||
<description>Contains core components required to build plugins for Media Browser Server.</description>
|
||||
<copyright>Copyright © Media Browser 2013</copyright>
|
||||
<dependencies>
|
||||
<dependency id="MediaBrowser.Common" version="3.0.429" />
|
||||
<dependency id="MediaBrowser.Common" version="3.0.430" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
|
|
Loading…
Reference in New Issue
Block a user