mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 22:07:13 -04:00
Fix race condition in adding dlna devices to session when the device is discovered repeatedly
This commit is contained in:
parent
7ec42b89a0
commit
7bb8985f11
@ -89,11 +89,6 @@ namespace Emby.Dlna.PlayTo
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_sessionManager.Sessions.Any(i => usn.IndexOf(i.DeviceId, StringComparison.OrdinalIgnoreCase) != -1))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var cancellationToken = _disposeCancellationTokenSource.Token;
|
var cancellationToken = _disposeCancellationTokenSource.Token;
|
||||||
|
|
||||||
await _sessionLock.WaitAsync(cancellationToken).ConfigureAwait(false);
|
await _sessionLock.WaitAsync(cancellationToken).ConfigureAwait(false);
|
||||||
@ -105,6 +100,11 @@ namespace Emby.Dlna.PlayTo
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_sessionManager.Sessions.Any(i => usn.IndexOf(i.DeviceId, StringComparison.OrdinalIgnoreCase) != -1))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
await AddDevice(info, location, cancellationToken).ConfigureAwait(false);
|
await AddDevice(info, location, cancellationToken).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
catch (OperationCanceledException)
|
catch (OperationCanceledException)
|
||||||
|
Loading…
Reference in New Issue
Block a user