aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Session/SessionManager.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-05-08 16:09:53 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-05-08 16:09:53 -0400
commitf02c3260273a09f465c4e7a97d8b90f0f6909734 (patch)
tree180760af62fcddc1964e000c6c57bd368dce836d /MediaBrowser.Server.Implementations/Session/SessionManager.cs
parent374dd8d44152e49f4616a9c8c3d36e8793ed037e (diff)
Removed guids from the model project
Diffstat (limited to 'MediaBrowser.Server.Implementations/Session/SessionManager.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Session/SessionManager.cs27
1 files changed, 18 insertions, 9 deletions
diff --git a/MediaBrowser.Server.Implementations/Session/SessionManager.cs b/MediaBrowser.Server.Implementations/Session/SessionManager.cs
index b187c8d6b..ea709cd24 100644
--- a/MediaBrowser.Server.Implementations/Session/SessionManager.cs
+++ b/MediaBrowser.Server.Implementations/Session/SessionManager.cs
@@ -1,4 +1,5 @@
-using MediaBrowser.Common.Events;
+using System.Globalization;
+using MediaBrowser.Common.Events;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Drawing;
@@ -712,12 +713,20 @@ namespace MediaBrowser.Server.Implementations.Session
public Task SendMessageCommand(string controllingSessionId, string sessionId, MessageCommand command, CancellationToken cancellationToken)
{
- var session = GetSessionForRemoteControl(sessionId);
+ var generalCommand = new GeneralCommand
+ {
+ Name = GeneralCommandType.DisplayMessage.ToString()
+ };
- var controllingSession = GetSession(controllingSessionId);
- AssertCanControl(session, controllingSession);
+ generalCommand.Arguments["Header"] = command.Header;
+ generalCommand.Arguments["Text"] = command.Text;
- return session.SessionController.SendMessageCommand(command, cancellationToken);
+ if (command.TimeoutMs.HasValue)
+ {
+ generalCommand.Arguments["TimeoutMs"] = command.TimeoutMs.Value.ToString(CultureInfo.InvariantCulture);
+ }
+
+ return SendGeneralCommand(controllingSessionId, sessionId, generalCommand, cancellationToken);
}
public Task SendGeneralCommand(string controllingSessionId, string sessionId, GeneralCommand command, CancellationToken cancellationToken)
@@ -1199,7 +1208,7 @@ namespace MediaBrowser.Server.Implementations.Session
};
info.PrimaryImageTag = GetImageCacheTag(item, ImageType.Primary);
- if (info.PrimaryImageTag.HasValue)
+ if (info.PrimaryImageTag != null)
{
info.PrimaryImageItemId = GetDtoId(item);
}
@@ -1237,14 +1246,14 @@ namespace MediaBrowser.Server.Implementations.Session
info.Album = audio.Album;
info.Artists = audio.Artists;
- if (!info.PrimaryImageTag.HasValue)
+ if (info.PrimaryImageTag == null)
{
var album = audio.Parents.OfType<MusicAlbum>().FirstOrDefault();
if (album != null && album.HasImage(ImageType.Primary))
{
info.PrimaryImageTag = GetImageCacheTag(album, ImageType.Primary);
- if (info.PrimaryImageTag.HasValue)
+ if (info.PrimaryImageTag != null)
{
info.PrimaryImageItemId = GetDtoId(album);
}
@@ -1345,7 +1354,7 @@ namespace MediaBrowser.Server.Implementations.Session
return info;
}
- private Guid? GetImageCacheTag(BaseItem item, ImageType type)
+ private string GetImageCacheTag(BaseItem item, ImageType type)
{
try
{