|
@@ -219,7 +219,7 @@ namespace MediaBrowser.Server.Implementations.Connect
|
|
{
|
|
{
|
|
throw new ArgumentNullException("wanApiAddress");
|
|
throw new ArgumentNullException("wanApiAddress");
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
var url = "Servers";
|
|
var url = "Servers";
|
|
url = GetConnectUrl(url);
|
|
url = GetConnectUrl(url);
|
|
|
|
|
|
@@ -699,7 +699,7 @@ namespace MediaBrowser.Server.Implementations.Connect
|
|
{
|
|
{
|
|
throw new ArgumentNullException("ConnectAccessKey");
|
|
throw new ArgumentNullException("ConnectAccessKey");
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
options.RequestHeaders.Add("X-Connect-Token", ConnectAccessKey);
|
|
options.RequestHeaders.Add("X-Connect-Token", ConnectAccessKey);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -723,7 +723,7 @@ namespace MediaBrowser.Server.Implementations.Connect
|
|
{
|
|
{
|
|
throw new ArgumentNullException("ConnectServerId");
|
|
throw new ArgumentNullException("ConnectServerId");
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
var url = GetConnectUrl("ServerAuthorizations");
|
|
var url = GetConnectUrl("ServerAuthorizations");
|
|
|
|
|
|
url += "?serverId=" + ConnectServerId;
|
|
url += "?serverId=" + ConnectServerId;
|
|
@@ -956,6 +956,10 @@ namespace MediaBrowser.Server.Implementations.Connect
|
|
_data.LastAuthorizationsRefresh = DateTime.UtcNow;
|
|
_data.LastAuthorizationsRefresh = DateTime.UtcNow;
|
|
CacheData();
|
|
CacheData();
|
|
}
|
|
}
|
|
|
|
+ catch (Exception ex)
|
|
|
|
+ {
|
|
|
|
+ _logger.ErrorException("Error refreshing authorization", ex);
|
|
|
|
+ }
|
|
finally
|
|
finally
|
|
{
|
|
{
|
|
_operationLock.Release();
|
|
_operationLock.Release();
|
|
@@ -1010,7 +1014,7 @@ namespace MediaBrowser.Server.Implementations.Connect
|
|
{
|
|
{
|
|
throw new ArgumentNullException("ConnectServerId");
|
|
throw new ArgumentNullException("ConnectServerId");
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
var url = GetConnectUrl("ServerAuthorizations");
|
|
var url = GetConnectUrl("ServerAuthorizations");
|
|
|
|
|
|
var options = new HttpRequestOptions
|
|
var options = new HttpRequestOptions
|
|
@@ -1074,7 +1078,7 @@ namespace MediaBrowser.Server.Implementations.Connect
|
|
});
|
|
});
|
|
|
|
|
|
SetApplicationHeader(options);
|
|
SetApplicationHeader(options);
|
|
-
|
|
|
|
|
|
+
|
|
// No need to examine the response
|
|
// No need to examine the response
|
|
using (var response = (await _httpClient.SendAsync(options, "POST").ConfigureAwait(false)).Content)
|
|
using (var response = (await _httpClient.SendAsync(options, "POST").ConfigureAwait(false)).Content)
|
|
{
|
|
{
|
|
@@ -1094,7 +1098,7 @@ namespace MediaBrowser.Server.Implementations.Connect
|
|
{
|
|
{
|
|
throw new ArgumentNullException("user");
|
|
throw new ArgumentNullException("user");
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
if (string.IsNullOrEmpty(user.ConnectUserId))
|
|
if (string.IsNullOrEmpty(user.ConnectUserId))
|
|
{
|
|
{
|
|
return;
|
|
return;
|