display additional transcoding info in dashboard

This commit is contained in:
Luke Pulverenti
2014-06-05 20:39:02 -04:00
parent 7049ad66f4
commit f7cd7182d5
15 changed files with 260 additions and 74 deletions

View File

@@ -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);
}
}
}