mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-01-15 15:48:03 +00:00
Fix SyncPlay WebSocket OpenAPI schemas (#13946)
This commit is contained in:
@@ -5,15 +5,18 @@ namespace MediaBrowser.Model.SyncPlay;
|
||||
/// <summary>
|
||||
/// Group update without data.
|
||||
/// </summary>
|
||||
public abstract class GroupUpdate
|
||||
/// <typeparam name="T">The type of the update data.</typeparam>
|
||||
public abstract class GroupUpdate<T>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GroupUpdate"/> class.
|
||||
/// Initializes a new instance of the <see cref="GroupUpdate{T}"/> class.
|
||||
/// </summary>
|
||||
/// <param name="groupId">The group identifier.</param>
|
||||
protected GroupUpdate(Guid groupId)
|
||||
/// <param name="data">The update data.</param>
|
||||
protected GroupUpdate(Guid groupId, T data)
|
||||
{
|
||||
GroupId = groupId;
|
||||
Data = data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -22,9 +25,15 @@ public abstract class GroupUpdate
|
||||
/// <value>The group identifier.</value>
|
||||
public Guid GroupId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the update data.
|
||||
/// </summary>
|
||||
/// <value>The update data.</value>
|
||||
public T Data { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the update type.
|
||||
/// </summary>
|
||||
/// <value>The update type.</value>
|
||||
public GroupUpdateType Type { get; init; }
|
||||
public abstract GroupUpdateType Type { get; }
|
||||
}
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
#pragma warning disable SA1649
|
||||
|
||||
using System;
|
||||
|
||||
namespace MediaBrowser.Model.SyncPlay;
|
||||
|
||||
/// <summary>
|
||||
/// Class GroupUpdate.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of the data of the message.</typeparam>
|
||||
public class GroupUpdate<T> : GroupUpdate
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GroupUpdate{T}"/> class.
|
||||
/// </summary>
|
||||
/// <param name="groupId">The group identifier.</param>
|
||||
/// <param name="type">The update type.</param>
|
||||
/// <param name="data">The update data.</param>
|
||||
public GroupUpdate(Guid groupId, GroupUpdateType type, T data)
|
||||
: base(groupId)
|
||||
{
|
||||
Data = data;
|
||||
Type = type;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the update data.
|
||||
/// </summary>
|
||||
/// <value>The update data.</value>
|
||||
public T Data { get; }
|
||||
}
|
||||
@@ -45,16 +45,6 @@ namespace MediaBrowser.Model.SyncPlay
|
||||
/// </summary>
|
||||
GroupDoesNotExist,
|
||||
|
||||
/// <summary>
|
||||
/// The create-group-denied error. Sent when a user tries to create a group without required permissions.
|
||||
/// </summary>
|
||||
CreateGroupDenied,
|
||||
|
||||
/// <summary>
|
||||
/// The join-group-denied error. Sent when a user tries to join a group without required permissions.
|
||||
/// </summary>
|
||||
JoinGroupDenied,
|
||||
|
||||
/// <summary>
|
||||
/// The library-access-denied error. Sent when a user tries to join a group without required access to the library.
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace MediaBrowser.Model.SyncPlay;
|
||||
|
||||
/// <inheritdoc />
|
||||
public class SyncPlayGroupDoesNotExistUpdate : GroupUpdate<string>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SyncPlayGroupDoesNotExistUpdate"/> class.
|
||||
/// </summary>
|
||||
/// <param name="groupId">The groupId.</param>
|
||||
/// <param name="data">The data.</param>
|
||||
public SyncPlayGroupDoesNotExistUpdate(Guid groupId, string data) : base(groupId, data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(GroupUpdateType.GroupDoesNotExist)]
|
||||
public override GroupUpdateType Type => GroupUpdateType.GroupDoesNotExist;
|
||||
}
|
||||
21
MediaBrowser.Model/SyncPlay/SyncPlayGroupJoinedUpdate.cs
Normal file
21
MediaBrowser.Model/SyncPlay/SyncPlayGroupJoinedUpdate.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace MediaBrowser.Model.SyncPlay;
|
||||
|
||||
/// <inheritdoc />
|
||||
public class SyncPlayGroupJoinedUpdate : GroupUpdate<GroupInfoDto>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SyncPlayGroupJoinedUpdate"/> class.
|
||||
/// </summary>
|
||||
/// <param name="groupId">The groupId.</param>
|
||||
/// <param name="data">The data.</param>
|
||||
public SyncPlayGroupJoinedUpdate(Guid groupId, GroupInfoDto data) : base(groupId, data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(GroupUpdateType.GroupJoined)]
|
||||
public override GroupUpdateType Type => GroupUpdateType.GroupJoined;
|
||||
}
|
||||
21
MediaBrowser.Model/SyncPlay/SyncPlayGroupLeftUpdate.cs
Normal file
21
MediaBrowser.Model/SyncPlay/SyncPlayGroupLeftUpdate.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace MediaBrowser.Model.SyncPlay;
|
||||
|
||||
/// <inheritdoc />
|
||||
public class SyncPlayGroupLeftUpdate : GroupUpdate<string>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SyncPlayGroupLeftUpdate"/> class.
|
||||
/// </summary>
|
||||
/// <param name="groupId">The groupId.</param>
|
||||
/// <param name="data">The data.</param>
|
||||
public SyncPlayGroupLeftUpdate(Guid groupId, string data) : base(groupId, data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(GroupUpdateType.GroupLeft)]
|
||||
public override GroupUpdateType Type => GroupUpdateType.GroupLeft;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace MediaBrowser.Model.SyncPlay;
|
||||
|
||||
/// <inheritdoc />
|
||||
public class SyncPlayLibraryAccessDeniedUpdate : GroupUpdate<string>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SyncPlayLibraryAccessDeniedUpdate"/> class.
|
||||
/// </summary>
|
||||
/// <param name="groupId">The groupId.</param>
|
||||
/// <param name="data">The data.</param>
|
||||
public SyncPlayLibraryAccessDeniedUpdate(Guid groupId, string data) : base(groupId, data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(GroupUpdateType.LibraryAccessDenied)]
|
||||
public override GroupUpdateType Type => GroupUpdateType.LibraryAccessDenied;
|
||||
}
|
||||
21
MediaBrowser.Model/SyncPlay/SyncPlayNotInGroupUpdate.cs
Normal file
21
MediaBrowser.Model/SyncPlay/SyncPlayNotInGroupUpdate.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace MediaBrowser.Model.SyncPlay;
|
||||
|
||||
/// <inheritdoc />
|
||||
public class SyncPlayNotInGroupUpdate : GroupUpdate<string>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SyncPlayNotInGroupUpdate"/> class.
|
||||
/// </summary>
|
||||
/// <param name="groupId">The groupId.</param>
|
||||
/// <param name="data">The data.</param>
|
||||
public SyncPlayNotInGroupUpdate(Guid groupId, string data) : base(groupId, data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(GroupUpdateType.NotInGroup)]
|
||||
public override GroupUpdateType Type => GroupUpdateType.NotInGroup;
|
||||
}
|
||||
21
MediaBrowser.Model/SyncPlay/SyncPlayPlayQueueUpdate.cs
Normal file
21
MediaBrowser.Model/SyncPlay/SyncPlayPlayQueueUpdate.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace MediaBrowser.Model.SyncPlay;
|
||||
|
||||
/// <inheritdoc />
|
||||
public class SyncPlayPlayQueueUpdate : GroupUpdate<PlayQueueUpdate>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SyncPlayPlayQueueUpdate"/> class.
|
||||
/// </summary>
|
||||
/// <param name="groupId">The groupId.</param>
|
||||
/// <param name="data">The data.</param>
|
||||
public SyncPlayPlayQueueUpdate(Guid groupId, PlayQueueUpdate data) : base(groupId, data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(GroupUpdateType.PlayQueue)]
|
||||
public override GroupUpdateType Type => GroupUpdateType.PlayQueue;
|
||||
}
|
||||
21
MediaBrowser.Model/SyncPlay/SyncPlayStateUpdate.cs
Normal file
21
MediaBrowser.Model/SyncPlay/SyncPlayStateUpdate.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace MediaBrowser.Model.SyncPlay;
|
||||
|
||||
/// <inheritdoc />
|
||||
public class SyncPlayStateUpdate : GroupUpdate<GroupStateUpdate>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SyncPlayStateUpdate"/> class.
|
||||
/// </summary>
|
||||
/// <param name="groupId">The groupId.</param>
|
||||
/// <param name="data">The data.</param>
|
||||
public SyncPlayStateUpdate(Guid groupId, GroupStateUpdate data) : base(groupId, data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(GroupUpdateType.StateUpdate)]
|
||||
public override GroupUpdateType Type => GroupUpdateType.StateUpdate;
|
||||
}
|
||||
21
MediaBrowser.Model/SyncPlay/SyncPlayUserJoinedUpdate.cs
Normal file
21
MediaBrowser.Model/SyncPlay/SyncPlayUserJoinedUpdate.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace MediaBrowser.Model.SyncPlay;
|
||||
|
||||
/// <inheritdoc />
|
||||
public class SyncPlayUserJoinedUpdate : GroupUpdate<string>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SyncPlayUserJoinedUpdate"/> class.
|
||||
/// </summary>
|
||||
/// <param name="groupId">The groupId.</param>
|
||||
/// <param name="data">The data.</param>
|
||||
public SyncPlayUserJoinedUpdate(Guid groupId, string data) : base(groupId, data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(GroupUpdateType.UserJoined)]
|
||||
public override GroupUpdateType Type => GroupUpdateType.UserJoined;
|
||||
}
|
||||
21
MediaBrowser.Model/SyncPlay/SyncPlayUserLeftUpdate.cs
Normal file
21
MediaBrowser.Model/SyncPlay/SyncPlayUserLeftUpdate.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace MediaBrowser.Model.SyncPlay;
|
||||
|
||||
/// <inheritdoc />
|
||||
public class SyncPlayUserLeftUpdate : GroupUpdate<string>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SyncPlayUserLeftUpdate"/> class.
|
||||
/// </summary>
|
||||
/// <param name="groupId">The groupId.</param>
|
||||
/// <param name="data">The data.</param>
|
||||
public SyncPlayUserLeftUpdate(Guid groupId, string data) : base(groupId, data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(GroupUpdateType.UserLeft)]
|
||||
public override GroupUpdateType Type => GroupUpdateType.UserLeft;
|
||||
}
|
||||
Reference in New Issue
Block a user