|
@@ -376,6 +376,11 @@ namespace MediaBrowser.Server.Implementations.Connect
|
|
|
|
|
|
public async Task<UserLinkResult> LinkUser(string userId, string connectUsername)
|
|
public async Task<UserLinkResult> LinkUser(string userId, string connectUsername)
|
|
{
|
|
{
|
|
|
|
+ if (string.IsNullOrWhiteSpace(ConnectServerId))
|
|
|
|
+ {
|
|
|
|
+ await UpdateConnectInfo().ConfigureAwait(false);
|
|
|
|
+ }
|
|
|
|
+
|
|
await _operationLock.WaitAsync().ConfigureAwait(false);
|
|
await _operationLock.WaitAsync().ConfigureAwait(false);
|
|
|
|
|
|
try
|
|
try
|
|
@@ -399,10 +404,6 @@ namespace MediaBrowser.Server.Implementations.Connect
|
|
throw new ArgumentNullException("connectUsername");
|
|
throw new ArgumentNullException("connectUsername");
|
|
}
|
|
}
|
|
if (string.IsNullOrWhiteSpace(ConnectServerId))
|
|
if (string.IsNullOrWhiteSpace(ConnectServerId))
|
|
- {
|
|
|
|
- await UpdateConnectInfo().ConfigureAwait(false);
|
|
|
|
- }
|
|
|
|
- if (string.IsNullOrWhiteSpace(ConnectServerId))
|
|
|
|
{
|
|
{
|
|
throw new ArgumentNullException("ConnectServerId");
|
|
throw new ArgumentNullException("ConnectServerId");
|
|
}
|
|
}
|
|
@@ -474,6 +475,11 @@ namespace MediaBrowser.Server.Implementations.Connect
|
|
|
|
|
|
public async Task<UserLinkResult> InviteUser(ConnectAuthorizationRequest request)
|
|
public async Task<UserLinkResult> InviteUser(ConnectAuthorizationRequest request)
|
|
{
|
|
{
|
|
|
|
+ if (string.IsNullOrWhiteSpace(ConnectServerId))
|
|
|
|
+ {
|
|
|
|
+ await UpdateConnectInfo().ConfigureAwait(false);
|
|
|
|
+ }
|
|
|
|
+
|
|
await _operationLock.WaitAsync().ConfigureAwait(false);
|
|
await _operationLock.WaitAsync().ConfigureAwait(false);
|
|
|
|
|
|
try
|
|
try
|
|
@@ -496,10 +502,6 @@ namespace MediaBrowser.Server.Implementations.Connect
|
|
throw new ArgumentNullException("connectUsername");
|
|
throw new ArgumentNullException("connectUsername");
|
|
}
|
|
}
|
|
if (string.IsNullOrWhiteSpace(ConnectServerId))
|
|
if (string.IsNullOrWhiteSpace(ConnectServerId))
|
|
- {
|
|
|
|
- await UpdateConnectInfo().ConfigureAwait(false);
|
|
|
|
- }
|
|
|
|
- if (string.IsNullOrWhiteSpace(ConnectServerId))
|
|
|
|
{
|
|
{
|
|
throw new ArgumentNullException("ConnectServerId");
|
|
throw new ArgumentNullException("ConnectServerId");
|
|
}
|
|
}
|