aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Session
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2016-11-12 02:49:33 -0500
committerGitHub <noreply@github.com>2016-11-12 02:49:33 -0500
commitd5197eabb0b2ac375cd7610aa7cc4a7e61a88245 (patch)
tree0f05bf569a19c75b9654af69d8356c67ff0c2de0 /Emby.Server.Implementations/Session
parent67b69ceb9418ef530296238d1776894b675f4c5e (diff)
parent6865bb53530abbf703b590dd39cfa27274b03107 (diff)
Merge pull request #2283 from MediaBrowser/dev
Dev
Diffstat (limited to 'Emby.Server.Implementations/Session')
-rw-r--r--Emby.Server.Implementations/Session/SessionManager.cs33
1 files changed, 25 insertions, 8 deletions
diff --git a/Emby.Server.Implementations/Session/SessionManager.cs b/Emby.Server.Implementations/Session/SessionManager.cs
index 960fe0739..300b67ae2 100644
--- a/Emby.Server.Implementations/Session/SessionManager.cs
+++ b/Emby.Server.Implementations/Session/SessionManager.cs
@@ -566,6 +566,23 @@ namespace Emby.Server.Implementations.Session
}
}
+ private BaseItem GetNowPlayingItem(SessionInfo session, string itemId)
+ {
+ var idGuid = new Guid(itemId);
+
+ var item = session.FullNowPlayingItem;
+ if (item != null && item.Id == idGuid)
+ {
+ return item;
+ }
+
+ item = _libraryManager.GetItemById(itemId);
+
+ session.FullNowPlayingItem = item;
+
+ return item;
+ }
+
/// <summary>
/// Used to report that playback has started for an item
/// </summary>
@@ -583,7 +600,7 @@ namespace Emby.Server.Implementations.Session
var libraryItem = string.IsNullOrWhiteSpace(info.ItemId)
? null
- : _libraryManager.GetItemById(new Guid(info.ItemId));
+ : GetNowPlayingItem(session, info.ItemId);
await UpdateNowPlayingItem(session, info, libraryItem).ConfigureAwait(false);
@@ -669,7 +686,7 @@ namespace Emby.Server.Implementations.Session
var libraryItem = string.IsNullOrWhiteSpace(info.ItemId)
? null
- : _libraryManager.GetItemById(new Guid(info.ItemId));
+ : GetNowPlayingItem(session, info.ItemId);
await UpdateNowPlayingItem(session, info, libraryItem).ConfigureAwait(false);
@@ -773,7 +790,7 @@ namespace Emby.Server.Implementations.Session
var libraryItem = string.IsNullOrWhiteSpace(info.ItemId)
? null
- : _libraryManager.GetItemById(new Guid(info.ItemId));
+ : GetNowPlayingItem(session, info.ItemId);
// Normalize
if (string.IsNullOrWhiteSpace(info.MediaSourceId))
@@ -1782,18 +1799,18 @@ namespace Emby.Server.Implementations.Session
throw new ArgumentNullException("itemId");
}
- var item = _libraryManager.GetItemById(new Guid(itemId));
+ //var item = _libraryManager.GetItemById(new Guid(itemId));
- var info = GetItemInfo(item, null, null);
+ //var info = GetItemInfo(item, null, null);
- ReportNowViewingItem(sessionId, info);
+ //ReportNowViewingItem(sessionId, info);
}
public void ReportNowViewingItem(string sessionId, BaseItemInfo item)
{
- var session = GetSession(sessionId);
+ //var session = GetSession(sessionId);
- session.NowViewingItem = item;
+ //session.NowViewingItem = item;
}
public void ReportTranscodingInfo(string deviceId, TranscodingInfo info)