aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs
diff options
context:
space:
mode:
author7illusions <z@7illusions.com>2014-08-30 19:06:58 +0200
committer7illusions <z@7illusions.com>2014-08-30 19:06:58 +0200
commit66ad1699e22029b605e17735e8d9450285d8748a (patch)
treeffc92c88d24850b2f82b6b3a8bdd904a2ccc77a5 /MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs
parent34bc54263e886aae777a3537dc50a6535b51330a (diff)
parent9d36f518182bc075c19d78084870f5115fa62d1e (diff)
Merge pull request #1 from MediaBrowser/master
Update to latest
Diffstat (limited to 'MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs19
1 files changed, 5 insertions, 14 deletions
diff --git a/MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs b/MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs
index 365845f41..ed590a1f2 100644
--- a/MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs
+++ b/MediaBrowser.Server.Implementations/Session/SessionWebSocketListener.cs
@@ -1,5 +1,4 @@
using MediaBrowser.Common.Net;
-using MediaBrowser.Controller;
using MediaBrowser.Controller.Session;
using MediaBrowser.Model.Logging;
using MediaBrowser.Model.Serialization;
@@ -113,21 +112,13 @@ namespace MediaBrowser.Server.Implementations.Session
var version = vals[2];
var deviceName = vals.Length > 3 ? vals[3] : string.Empty;
- var session = _sessionManager.Sessions
- .FirstOrDefault(i => string.Equals(i.DeviceId, deviceId) &&
- string.Equals(i.Client, client) &&
- string.Equals(i.ApplicationVersion, version));
+ var session = _sessionManager.GetSession(deviceId, client, version);
if (session == null && !string.IsNullOrEmpty(deviceName))
{
_logger.Debug("Logging session activity");
- await _sessionManager.LogSessionActivity(client, version, deviceId, deviceName, message.Connection.RemoteEndPoint, null).ConfigureAwait(false);
-
- session = _sessionManager.Sessions
- .FirstOrDefault(i => string.Equals(i.DeviceId, deviceId) &&
- string.Equals(i.Client, client) &&
- string.Equals(i.ApplicationVersion, version));
+ session = await _sessionManager.LogSessionActivity(client, version, deviceId, deviceName, message.Connection.RemoteEndPoint, null).ConfigureAwait(false);
}
if (session != null)
@@ -197,7 +188,7 @@ namespace MediaBrowser.Server.Implementations.Session
}
private readonly CultureInfo _usCulture = new CultureInfo("en-US");
-
+
/// <summary>
/// Reports the playback start.
/// </summary>
@@ -284,7 +275,7 @@ namespace MediaBrowser.Server.Implementations.Session
_sessionManager.OnPlaybackProgress(info);
}
}
-
+
/// <summary>
/// Reports the playback progress.
/// </summary>
@@ -362,7 +353,7 @@ namespace MediaBrowser.Server.Implementations.Session
_sessionManager.OnPlaybackStopped(info);
}
}
-
+
/// <summary>
/// Reports the playback stopped.
/// </summary>