aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Session/SessionManager.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-05-10 13:28:03 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-05-10 13:28:03 -0400
commit4e816552395c1b57868ccd29f6f2e9b70d7272a5 (patch)
tree6ab816e59c9e32f56d726b04e068cf1367269097 /MediaBrowser.Server.Implementations/Session/SessionManager.cs
parentb9a2af1fd523e22f387e3130bf68b09e4369600f (diff)
updated mono build
Diffstat (limited to 'MediaBrowser.Server.Implementations/Session/SessionManager.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Session/SessionManager.cs20
1 files changed, 15 insertions, 5 deletions
diff --git a/MediaBrowser.Server.Implementations/Session/SessionManager.cs b/MediaBrowser.Server.Implementations/Session/SessionManager.cs
index ea709cd24..d2a047b42 100644
--- a/MediaBrowser.Server.Implementations/Session/SessionManager.cs
+++ b/MediaBrowser.Server.Implementations/Session/SessionManager.cs
@@ -282,7 +282,18 @@ namespace MediaBrowser.Server.Implementations.Session
if (!string.IsNullOrWhiteSpace(info.ItemId) && libraryItem != null)
{
- info.Item = GetItemInfo(libraryItem, runtimeTicks, libraryItem, info.MediaSourceId);
+ var current = session.NowPlayingItem;
+
+ if (current == null || !string.Equals(current.Id, info.ItemId, StringComparison.OrdinalIgnoreCase))
+ {
+ info.Item = GetItemInfo(libraryItem, libraryItem, info.MediaSourceId);
+ }
+ else
+ {
+ info.Item = current;
+ }
+
+ info.Item.RunTimeTicks = runtimeTicks;
}
session.NowPlayingItem = info.Item;
@@ -1182,12 +1193,11 @@ namespace MediaBrowser.Server.Implementations.Session
/// Converts a BaseItem to a BaseItemInfo
/// </summary>
/// <param name="item">The item.</param>
- /// <param name="runtimeTicks">The now playing runtime ticks.</param>
/// <param name="chapterOwner">The chapter owner.</param>
/// <param name="mediaSourceId">The media source identifier.</param>
/// <returns>BaseItemInfo.</returns>
/// <exception cref="System.ArgumentNullException">item</exception>
- private BaseItemInfo GetItemInfo(BaseItem item, long? runtimeTicks, BaseItem chapterOwner, string mediaSourceId)
+ private BaseItemInfo GetItemInfo(BaseItem item, BaseItem chapterOwner, string mediaSourceId)
{
if (item == null)
{
@@ -1200,7 +1210,7 @@ namespace MediaBrowser.Server.Implementations.Session
Name = item.Name,
MediaType = item.MediaType,
Type = item.GetClientTypeName(),
- RunTimeTicks = runtimeTicks,
+ RunTimeTicks = item.RunTimeTicks,
IndexNumber = item.IndexNumber,
ParentIndexNumber = item.ParentIndexNumber,
PremiereDate = item.PremiereDate,
@@ -1376,7 +1386,7 @@ namespace MediaBrowser.Server.Implementations.Session
{
var item = _libraryManager.GetItemById(new Guid(itemId));
- var info = GetItemInfo(item, item.RunTimeTicks, null, null);
+ var info = GetItemInfo(item, null, null);
ReportNowViewingItem(sessionId, info);
}