|
|
|
@ -1064,10 +1064,10 @@ namespace Emby.Server.Implementations.Session
|
|
|
|
|
AssertCanControl(session, controllingSession);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return SendMessageToSession(session, "GeneralCommand", command, cancellationToken);
|
|
|
|
|
return SendMessageToSession(session, SessionMessageType.GeneralCommand, command, cancellationToken);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static async Task SendMessageToSession<T>(SessionInfo session, string name, T data, CancellationToken cancellationToken)
|
|
|
|
|
private static async Task SendMessageToSession<T>(SessionInfo session, SessionMessageType name, T data, CancellationToken cancellationToken)
|
|
|
|
|
{
|
|
|
|
|
var controllers = session.SessionControllers;
|
|
|
|
|
var messageId = Guid.NewGuid();
|
|
|
|
@ -1078,7 +1078,7 @@ namespace Emby.Server.Implementations.Session
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static Task SendMessageToSessions<T>(IEnumerable<SessionInfo> sessions, string name, T data, CancellationToken cancellationToken)
|
|
|
|
|
private static Task SendMessageToSessions<T>(IEnumerable<SessionInfo> sessions, SessionMessageType name, T data, CancellationToken cancellationToken)
|
|
|
|
|
{
|
|
|
|
|
IEnumerable<Task> GetTasks()
|
|
|
|
|
{
|
|
|
|
@ -1178,7 +1178,7 @@ namespace Emby.Server.Implementations.Session
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await SendMessageToSession(session, "Play", command, cancellationToken).ConfigureAwait(false);
|
|
|
|
|
await SendMessageToSession(session, SessionMessageType.Play, command, cancellationToken).ConfigureAwait(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
@ -1186,7 +1186,7 @@ namespace Emby.Server.Implementations.Session
|
|
|
|
|
{
|
|
|
|
|
CheckDisposed();
|
|
|
|
|
var session = GetSessionToRemoteControl(sessionId);
|
|
|
|
|
await SendMessageToSession(session, "SyncPlayCommand", command, cancellationToken).ConfigureAwait(false);
|
|
|
|
|
await SendMessageToSession(session, SessionMessageType.SyncPlayCommand, command, cancellationToken).ConfigureAwait(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
@ -1194,7 +1194,7 @@ namespace Emby.Server.Implementations.Session
|
|
|
|
|
{
|
|
|
|
|
CheckDisposed();
|
|
|
|
|
var session = GetSessionToRemoteControl(sessionId);
|
|
|
|
|
await SendMessageToSession(session, "SyncPlayGroupUpdate", command, cancellationToken).ConfigureAwait(false);
|
|
|
|
|
await SendMessageToSession(session, SessionMessageType.SyncPlayGroupUpdate, command, cancellationToken).ConfigureAwait(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private IEnumerable<BaseItem> TranslateItemForPlayback(Guid id, User user)
|
|
|
|
@ -1297,7 +1297,7 @@ namespace Emby.Server.Implementations.Session
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return SendMessageToSession(session, "Playstate", command, cancellationToken);
|
|
|
|
|
return SendMessageToSession(session, SessionMessageType.PlayState, command, cancellationToken);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static void AssertCanControl(SessionInfo session, SessionInfo controllingSession)
|
|
|
|
@ -1322,7 +1322,7 @@ namespace Emby.Server.Implementations.Session
|
|
|
|
|
{
|
|
|
|
|
CheckDisposed();
|
|
|
|
|
|
|
|
|
|
return SendMessageToSessions(Sessions, "RestartRequired", string.Empty, cancellationToken);
|
|
|
|
|
return SendMessageToSessions(Sessions, SessionMessageType.RestartRequired, string.Empty, cancellationToken);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -1334,7 +1334,7 @@ namespace Emby.Server.Implementations.Session
|
|
|
|
|
{
|
|
|
|
|
CheckDisposed();
|
|
|
|
|
|
|
|
|
|
return SendMessageToSessions(Sessions, "ServerShuttingDown", string.Empty, cancellationToken);
|
|
|
|
|
return SendMessageToSessions(Sessions, SessionMessageType.ServerShuttingDown, string.Empty, cancellationToken);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -1348,7 +1348,7 @@ namespace Emby.Server.Implementations.Session
|
|
|
|
|
|
|
|
|
|
_logger.LogDebug("Beginning SendServerRestartNotification");
|
|
|
|
|
|
|
|
|
|
return SendMessageToSessions(Sessions, "ServerRestarting", string.Empty, cancellationToken);
|
|
|
|
|
return SendMessageToSessions(Sessions, SessionMessageType.ServerRestarting, string.Empty, cancellationToken);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -1874,7 +1874,7 @@ namespace Emby.Server.Implementations.Session
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
public Task SendMessageToAdminSessions<T>(string name, T data, CancellationToken cancellationToken)
|
|
|
|
|
public Task SendMessageToAdminSessions<T>(SessionMessageType name, T data, CancellationToken cancellationToken)
|
|
|
|
|
{
|
|
|
|
|
CheckDisposed();
|
|
|
|
|
|
|
|
|
@ -1887,7 +1887,7 @@ namespace Emby.Server.Implementations.Session
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
public Task SendMessageToUserSessions<T>(List<Guid> userIds, string name, Func<T> dataFn, CancellationToken cancellationToken)
|
|
|
|
|
public Task SendMessageToUserSessions<T>(List<Guid> userIds, SessionMessageType name, Func<T> dataFn, CancellationToken cancellationToken)
|
|
|
|
|
{
|
|
|
|
|
CheckDisposed();
|
|
|
|
|
|
|
|
|
@ -1902,7 +1902,7 @@ namespace Emby.Server.Implementations.Session
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
public Task SendMessageToUserSessions<T>(List<Guid> userIds, string name, T data, CancellationToken cancellationToken)
|
|
|
|
|
public Task SendMessageToUserSessions<T>(List<Guid> userIds, SessionMessageType name, T data, CancellationToken cancellationToken)
|
|
|
|
|
{
|
|
|
|
|
CheckDisposed();
|
|
|
|
|
|
|
|
|
@ -1911,7 +1911,7 @@ namespace Emby.Server.Implementations.Session
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
public Task SendMessageToUserDeviceSessions<T>(string deviceId, string name, T data, CancellationToken cancellationToken)
|
|
|
|
|
public Task SendMessageToUserDeviceSessions<T>(string deviceId, SessionMessageType name, T data, CancellationToken cancellationToken)
|
|
|
|
|
{
|
|
|
|
|
CheckDisposed();
|
|
|
|
|
|
|
|
|
|