From f7cd7182d55779b623c8da34bb3ca3b524194830 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 5 Jun 2014 20:39:02 -0400 Subject: display additional transcoding info in dashboard --- .../Session/SessionManager.cs | 28 +++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'MediaBrowser.Server.Implementations/Session') diff --git a/MediaBrowser.Server.Implementations/Session/SessionManager.cs b/MediaBrowser.Server.Implementations/Session/SessionManager.cs index a33db0c13..2d032cc31 100644 --- a/MediaBrowser.Server.Implementations/Session/SessionManager.cs +++ b/MediaBrowser.Server.Implementations/Session/SessionManager.cs @@ -347,6 +347,11 @@ namespace MediaBrowser.Server.Implementations.Session { session.NowPlayingItem = null; session.PlayState = new PlayerStateInfo(); + + if (!string.IsNullOrEmpty(session.DeviceId)) + { + ClearTranscodingInfo(session.DeviceId); + } } private string GetSessionKey(string clientType, string appVersion, string deviceId) @@ -459,6 +464,11 @@ namespace MediaBrowser.Server.Implementations.Session UpdateNowPlayingItem(session, info, libraryItem); + if (!string.IsNullOrEmpty(session.DeviceId)) + { + ClearTranscodingInfo(session.DeviceId); + } + session.QueueableMediaTypes = info.QueueableMediaTypes; var users = GetUsers(session); @@ -1264,7 +1274,8 @@ namespace MediaBrowser.Server.Implementations.Session UserName = session.UserName, NowPlayingItem = session.NowPlayingItem, SupportsRemoteControl = session.SupportsMediaControl, - PlayState = session.PlayState + PlayState = session.PlayState, + TranscodingInfo = session.TranscodingInfo }; if (session.UserId.HasValue) @@ -1490,5 +1501,20 @@ namespace MediaBrowser.Server.Implementations.Session session.NowViewingItem = item; } + + public void ReportTranscodingInfo(string deviceId, TranscodingInfo info) + { + var session = Sessions.FirstOrDefault(i => string.Equals(i.DeviceId, deviceId)); + + if (session != null) + { + session.TranscodingInfo = info; + } + } + + public void ClearTranscodingInfo(string deviceId) + { + ReportTranscodingInfo(deviceId, null); + } } } \ No newline at end of file -- cgit v1.2.3