mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-21 01:24:44 +01:00
Fix SyncPlay WebSocket OpenAPI schemas (#13946)
This commit is contained in:
@@ -273,7 +273,7 @@ namespace Emby.Server.Implementations.SyncPlay
|
||||
SetState(waitingState);
|
||||
}
|
||||
|
||||
var updateSession = NewSyncPlayGroupUpdate(GroupUpdateType.GroupJoined, GetInfo());
|
||||
var updateSession = new SyncPlayGroupJoinedUpdate(GroupId, GetInfo());
|
||||
SendGroupUpdate(session, SyncPlayBroadcastType.CurrentSession, updateSession, cancellationToken);
|
||||
|
||||
_state.SessionJoined(this, _state.Type, session, cancellationToken);
|
||||
@@ -291,10 +291,10 @@ namespace Emby.Server.Implementations.SyncPlay
|
||||
{
|
||||
AddSession(session);
|
||||
|
||||
var updateSession = NewSyncPlayGroupUpdate(GroupUpdateType.GroupJoined, GetInfo());
|
||||
var updateSession = new SyncPlayGroupJoinedUpdate(GroupId, GetInfo());
|
||||
SendGroupUpdate(session, SyncPlayBroadcastType.CurrentSession, updateSession, cancellationToken);
|
||||
|
||||
var updateOthers = NewSyncPlayGroupUpdate(GroupUpdateType.UserJoined, session.UserName);
|
||||
var updateOthers = new SyncPlayUserJoinedUpdate(GroupId, session.UserName);
|
||||
SendGroupUpdate(session, SyncPlayBroadcastType.AllExceptCurrentSession, updateOthers, cancellationToken);
|
||||
|
||||
_state.SessionJoined(this, _state.Type, session, cancellationToken);
|
||||
@@ -314,10 +314,10 @@ namespace Emby.Server.Implementations.SyncPlay
|
||||
|
||||
RemoveSession(session);
|
||||
|
||||
var updateSession = NewSyncPlayGroupUpdate(GroupUpdateType.GroupLeft, GroupId.ToString());
|
||||
var updateSession = new SyncPlayGroupLeftUpdate(GroupId, GroupId.ToString());
|
||||
SendGroupUpdate(session, SyncPlayBroadcastType.CurrentSession, updateSession, cancellationToken);
|
||||
|
||||
var updateOthers = NewSyncPlayGroupUpdate(GroupUpdateType.UserLeft, session.UserName);
|
||||
var updateOthers = new SyncPlayUserLeftUpdate(GroupId, session.UserName);
|
||||
SendGroupUpdate(session, SyncPlayBroadcastType.AllExceptCurrentSession, updateOthers, cancellationToken);
|
||||
|
||||
_logger.LogInformation("Session {SessionId} left group {GroupId}.", session.Id, GroupId.ToString());
|
||||
@@ -425,12 +425,6 @@ namespace Emby.Server.Implementations.SyncPlay
|
||||
DateTime.UtcNow);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public GroupUpdate<T> NewSyncPlayGroupUpdate<T>(GroupUpdateType type, T data)
|
||||
{
|
||||
return new GroupUpdate<T>(GroupId, type, data);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public long SanitizePositionTicks(long? positionTicks)
|
||||
{
|
||||
|
||||
@@ -159,7 +159,7 @@ namespace Emby.Server.Implementations.SyncPlay
|
||||
{
|
||||
_logger.LogWarning("Session {SessionId} tried to join group {GroupId} that does not exist.", session.Id, request.GroupId);
|
||||
|
||||
var error = new GroupUpdate<string>(Guid.Empty, GroupUpdateType.GroupDoesNotExist, string.Empty);
|
||||
var error = new SyncPlayGroupDoesNotExistUpdate(Guid.Empty, string.Empty);
|
||||
_sessionManager.SendSyncPlayGroupUpdate(session.Id, error, CancellationToken.None);
|
||||
return;
|
||||
}
|
||||
@@ -171,7 +171,7 @@ namespace Emby.Server.Implementations.SyncPlay
|
||||
{
|
||||
_logger.LogWarning("Session {SessionId} tried to join group {GroupId} but does not have access to some content of the playing queue.", session.Id, group.GroupId.ToString());
|
||||
|
||||
var error = new GroupUpdate<string>(group.GroupId, GroupUpdateType.LibraryAccessDenied, string.Empty);
|
||||
var error = new SyncPlayLibraryAccessDeniedUpdate(group.GroupId, string.Empty);
|
||||
_sessionManager.SendSyncPlayGroupUpdate(session.Id, error, CancellationToken.None);
|
||||
return;
|
||||
}
|
||||
@@ -248,7 +248,7 @@ namespace Emby.Server.Implementations.SyncPlay
|
||||
{
|
||||
_logger.LogWarning("Session {SessionId} does not belong to any group.", session.Id);
|
||||
|
||||
var error = new GroupUpdate<string>(Guid.Empty, GroupUpdateType.NotInGroup, string.Empty);
|
||||
var error = new SyncPlayNotInGroupUpdate(Guid.Empty, string.Empty);
|
||||
_sessionManager.SendSyncPlayGroupUpdate(session.Id, error, CancellationToken.None);
|
||||
}
|
||||
}
|
||||
@@ -327,7 +327,7 @@ namespace Emby.Server.Implementations.SyncPlay
|
||||
{
|
||||
_logger.LogWarning("Session {SessionId} does not belong to any group.", session.Id);
|
||||
|
||||
var error = new GroupUpdate<string>(Guid.Empty, GroupUpdateType.NotInGroup, string.Empty);
|
||||
var error = new SyncPlayNotInGroupUpdate(Guid.Empty, string.Empty);
|
||||
_sessionManager.SendSyncPlayGroupUpdate(session.Id, error, CancellationToken.None);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user