diff options
Diffstat (limited to 'MediaBrowser.Server.Implementations/Session/SessionManager.cs')
| -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 |
