aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Session/WebSocketController.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-03-21 12:10:02 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-03-21 12:10:02 -0400
commitc0aec48a31d96726a6fb1814f28b6971fabca163 (patch)
tree5ae0f4c295a722dfbc91e93d20b632d449adcf4e /MediaBrowser.Server.Implementations/Session/WebSocketController.cs
parente068e84ab6c2bdee49c41ceef50cbcedd8bcb355 (diff)
beta fixes
Diffstat (limited to 'MediaBrowser.Server.Implementations/Session/WebSocketController.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Session/WebSocketController.cs19
1 files changed, 16 insertions, 3 deletions
diff --git a/MediaBrowser.Server.Implementations/Session/WebSocketController.cs b/MediaBrowser.Server.Implementations/Session/WebSocketController.cs
index f51998fea..d4ecd9572 100644
--- a/MediaBrowser.Server.Implementations/Session/WebSocketController.cs
+++ b/MediaBrowser.Server.Implementations/Session/WebSocketController.cs
@@ -30,17 +30,28 @@ namespace MediaBrowser.Server.Implementations.Session
Sockets = new List<IWebSocketConnection>();
}
+ private bool HasOpenSockets
+ {
+ get { return GetActiveSockets().Any(); }
+ }
+
+ public bool SupportsMediaControl
+ {
+ get { return HasOpenSockets; }
+ }
+
+ private bool _isActive;
public bool IsSessionActive
{
get
{
- return Sockets.Any(i => i.State == WebSocketState.Open);
+ return _isActive;
}
}
- public bool SupportsMediaControl
+ public void OnActivity()
{
- get { return GetActiveSockets().Any(); }
+ _isActive = true;
}
private IEnumerable<IWebSocketConnection> GetActiveSockets()
@@ -64,6 +75,8 @@ namespace MediaBrowser.Server.Implementations.Session
{
if (!GetActiveSockets().Any())
{
+ _isActive = false;
+
try
{
_sessionManager.ReportSessionEnded(Session.Id);