diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-06-05 20:39:02 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-06-05 20:39:02 -0400 |
| commit | f7cd7182d55779b623c8da34bb3ca3b524194830 (patch) | |
| tree | eeb2ff3107df9a2eeea4630d2c6a09339a354336 /MediaBrowser.Server.Implementations/Session | |
| parent | 7049ad66f47f4de3a62e0cc10ca8911f1dc454a7 (diff) | |
display additional transcoding info in dashboard
Diffstat (limited to 'MediaBrowser.Server.Implementations/Session')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Session/SessionManager.cs | 28 |
1 files changed, 27 insertions, 1 deletions
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 |
