Implement syncplay backend

This commit is contained in:
gion
2020-04-01 17:52:42 +02:00
parent ab8a5595f6
commit 10c2c62f07
17 changed files with 1491 additions and 0 deletions

View File

@@ -25,6 +25,7 @@ using MediaBrowser.Model.Events;
using MediaBrowser.Model.Library;
using MediaBrowser.Model.Querying;
using MediaBrowser.Model.Session;
using MediaBrowser.Model.Syncplay;
using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.Session
@@ -1154,6 +1155,22 @@ namespace Emby.Server.Implementations.Session
await SendMessageToSession(session, "Play", command, cancellationToken).ConfigureAwait(false);
}
/// <inheritdoc />
public async Task SendSyncplayCommand(string sessionId, SyncplayCommand command, CancellationToken cancellationToken)
{
CheckDisposed();
var session = GetSessionToRemoteControl(sessionId);
await SendMessageToSession(session, "SyncplayCommand", command, cancellationToken).ConfigureAwait(false);
}
/// <inheritdoc />
public async Task SendSyncplayGroupUpdate<T>(string sessionId, SyncplayGroupUpdate<T> command, CancellationToken cancellationToken)
{
CheckDisposed();
var session = GetSessionToRemoteControl(sessionId);
await SendMessageToSession(session, "SyncplayGroupUpdate", command, cancellationToken).ConfigureAwait(false);
}
private IEnumerable<BaseItem> TranslateItemForPlayback(Guid id, User user)
{
var item = _libraryManager.GetItemById(id);