aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Session/SessionManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Server.Implementations/Session/SessionManager.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Session/SessionManager.cs20
1 files changed, 9 insertions, 11 deletions
diff --git a/MediaBrowser.Server.Implementations/Session/SessionManager.cs b/MediaBrowser.Server.Implementations/Session/SessionManager.cs
index d78fae87b..0ee9e6213 100644
--- a/MediaBrowser.Server.Implementations/Session/SessionManager.cs
+++ b/MediaBrowser.Server.Implementations/Session/SessionManager.cs
@@ -248,7 +248,7 @@ namespace MediaBrowser.Server.Implementations.Session
return session;
}
- public async Task ReportSessionEnded(string sessionId)
+ public async void ReportSessionEnded(string sessionId)
{
await _sessionLock.WaitAsync(CancellationToken.None).ConfigureAwait(false);
@@ -256,18 +256,16 @@ namespace MediaBrowser.Server.Implementations.Session
{
var session = GetSession(sessionId);
- if (session == null)
+ if (session != null)
{
- throw new ArgumentException("Session not found");
- }
-
- var key = GetSessionKey(session.Client, session.ApplicationVersion, session.DeviceId);
+ var key = GetSessionKey(session.Client, session.ApplicationVersion, session.DeviceId);
- SessionInfo removed;
+ SessionInfo removed;
- if (_activeConnections.TryRemove(key, out removed))
- {
- OnSessionEnded(removed);
+ if (_activeConnections.TryRemove(key, out removed))
+ {
+ OnSessionEnded(removed);
+ }
}
}
finally
@@ -1155,7 +1153,7 @@ namespace MediaBrowser.Server.Implementations.Session
if (controller == null)
{
- session.SessionController = new HttpSessionController(_httpClient, _jsonSerializer, session, postUrl);
+ session.SessionController = new HttpSessionController(_httpClient, _jsonSerializer, session, postUrl, this);
}
}