Removed guids from the model project

This commit is contained in:
Luke Pulverenti
2014-05-08 16:09:53 -04:00
parent 374dd8d441
commit f02c326027
72 changed files with 380 additions and 503 deletions

View File

@@ -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
{

View File

@@ -57,18 +57,6 @@ namespace MediaBrowser.Server.Implementations.Session
return socket;
}
public Task SendMessageCommand(MessageCommand command, CancellationToken cancellationToken)
{
var socket = GetActiveSocket();
return socket.SendAsync(new WebSocketMessage<MessageCommand>
{
MessageType = "MessageCommand",
Data = command
}, cancellationToken);
}
public Task SendPlayCommand(PlayRequest command, CancellationToken cancellationToken)
{
var socket = GetActiveSocket();