repo creation with initial code after cloning public repo

This commit is contained in:
2026-02-19 07:36:25 -05:00
commit 460884fea3
2860 changed files with 650825 additions and 0 deletions
@@ -0,0 +1,58 @@
using System;
using System.Collections.Generic;
namespace MediaBrowser.Model.SyncPlay
{
/// <summary>
/// Class GroupInfoDto.
/// </summary>
public class GroupInfoDto
{
/// <summary>
/// Initializes a new instance of the <see cref="GroupInfoDto"/> class.
/// </summary>
/// <param name="groupId">The group identifier.</param>
/// <param name="groupName">The group name.</param>
/// <param name="state">The group state.</param>
/// <param name="participants">The participants.</param>
/// <param name="lastUpdatedAt">The date when this DTO has been created.</param>
public GroupInfoDto(Guid groupId, string groupName, GroupStateType state, IReadOnlyList<string> participants, DateTime lastUpdatedAt)
{
GroupId = groupId;
GroupName = groupName;
State = state;
Participants = participants;
LastUpdatedAt = lastUpdatedAt;
}
/// <summary>
/// Gets the group identifier.
/// </summary>
/// <value>The group identifier.</value>
public Guid GroupId { get; }
/// <summary>
/// Gets the group name.
/// </summary>
/// <value>The group name.</value>
public string GroupName { get; }
/// <summary>
/// Gets the group state.
/// </summary>
/// <value>The group state.</value>
public GroupStateType State { get; }
/// <summary>
/// Gets the participants.
/// </summary>
/// <value>The participants.</value>
public IReadOnlyList<string> Participants { get; }
/// <summary>
/// Gets the date when this DTO has been created.
/// </summary>
/// <value>The date when this DTO has been created.</value>
public DateTime LastUpdatedAt { get; }
}
}
@@ -0,0 +1,18 @@
namespace MediaBrowser.Model.SyncPlay
{
/// <summary>
/// Enum GroupQueueMode.
/// </summary>
public enum GroupQueueMode
{
/// <summary>
/// Insert items at the end of the queue.
/// </summary>
Queue = 0,
/// <summary>
/// Insert items after the currently playing item.
/// </summary>
QueueNext = 1
}
}
@@ -0,0 +1,23 @@
namespace MediaBrowser.Model.SyncPlay
{
/// <summary>
/// Enum GroupRepeatMode.
/// </summary>
public enum GroupRepeatMode
{
/// <summary>
/// Repeat one item only.
/// </summary>
RepeatOne = 0,
/// <summary>
/// Cycle the playlist.
/// </summary>
RepeatAll = 1,
/// <summary>
/// Do not repeat.
/// </summary>
RepeatNone = 2
}
}
@@ -0,0 +1,18 @@
namespace MediaBrowser.Model.SyncPlay
{
/// <summary>
/// Enum GroupShuffleMode.
/// </summary>
public enum GroupShuffleMode
{
/// <summary>
/// Sorted playlist.
/// </summary>
Sorted = 0,
/// <summary>
/// Shuffled playlist.
/// </summary>
Shuffle = 1
}
}
@@ -0,0 +1,28 @@
namespace MediaBrowser.Model.SyncPlay
{
/// <summary>
/// Enum GroupState.
/// </summary>
public enum GroupStateType
{
/// <summary>
/// The group is in idle state. No media is playing.
/// </summary>
Idle = 0,
/// <summary>
/// The group is in waiting state. Playback is paused. Will start playing when users are ready.
/// </summary>
Waiting = 1,
/// <summary>
/// The group is in paused state. Playback is paused. Will resume on play command.
/// </summary>
Paused = 2,
/// <summary>
/// The group is in playing state. Playback is advancing.
/// </summary>
Playing = 3
}
}
@@ -0,0 +1,31 @@
namespace MediaBrowser.Model.SyncPlay
{
/// <summary>
/// Class GroupStateUpdate.
/// </summary>
public class GroupStateUpdate
{
/// <summary>
/// Initializes a new instance of the <see cref="GroupStateUpdate"/> class.
/// </summary>
/// <param name="state">The state of the group.</param>
/// <param name="reason">The reason of the state change.</param>
public GroupStateUpdate(GroupStateType state, PlaybackRequestType reason)
{
State = state;
Reason = reason;
}
/// <summary>
/// Gets the state of the group.
/// </summary>
/// <value>The state of the group.</value>
public GroupStateType State { get; }
/// <summary>
/// Gets the reason of the state change.
/// </summary>
/// <value>The reason of the state change.</value>
public PlaybackRequestType Reason { get; }
}
}
@@ -0,0 +1,39 @@
using System;
namespace MediaBrowser.Model.SyncPlay;
/// <summary>
/// Group update without data.
/// </summary>
/// <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{T}"/> class.
/// </summary>
/// <param name="groupId">The group identifier.</param>
/// <param name="data">The update data.</param>
protected GroupUpdate(Guid groupId, T data)
{
GroupId = groupId;
Data = data;
}
/// <summary>
/// Gets the group identifier.
/// </summary>
/// <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 abstract GroupUpdateType Type { get; }
}
@@ -0,0 +1,53 @@
namespace MediaBrowser.Model.SyncPlay
{
/// <summary>
/// Enum GroupUpdateType.
/// </summary>
public enum GroupUpdateType
{
/// <summary>
/// The user-joined update. Tells members of a group about a new user.
/// </summary>
UserJoined,
/// <summary>
/// The user-left update. Tells members of a group that a user left.
/// </summary>
UserLeft,
/// <summary>
/// The group-joined update. Tells a user that the group has been joined.
/// </summary>
GroupJoined,
/// <summary>
/// The group-left update. Tells a user that the group has been left.
/// </summary>
GroupLeft,
/// <summary>
/// The group-state update. Tells members of the group that the state changed.
/// </summary>
StateUpdate,
/// <summary>
/// The play-queue update. Tells a user the playing queue of the group.
/// </summary>
PlayQueue,
/// <summary>
/// The not-in-group error. Tells a user that they don't belong to a group.
/// </summary>
NotInGroup,
/// <summary>
/// The group-does-not-exist error. Sent when trying to join a non-existing group.
/// </summary>
GroupDoesNotExist,
/// <summary>
/// The library-access-denied error. Sent when a user tries to join a group without required access to the library.
/// </summary>
LibraryAccessDenied
}
}
@@ -0,0 +1,82 @@
using System;
using System.Collections.Generic;
namespace MediaBrowser.Model.SyncPlay
{
/// <summary>
/// Class PlayQueueUpdate.
/// </summary>
public class PlayQueueUpdate
{
/// <summary>
/// Initializes a new instance of the <see cref="PlayQueueUpdate"/> class.
/// </summary>
/// <param name="reason">The reason for the update.</param>
/// <param name="lastUpdate">The UTC time of the last change to the playing queue.</param>
/// <param name="playlist">The playlist.</param>
/// <param name="playingItemIndex">The playing item index in the playlist.</param>
/// <param name="startPositionTicks">The start position ticks.</param>
/// <param name="isPlaying">The playing item status.</param>
/// <param name="shuffleMode">The shuffle mode.</param>
/// <param name="repeatMode">The repeat mode.</param>
public PlayQueueUpdate(PlayQueueUpdateReason reason, DateTime lastUpdate, IReadOnlyList<SyncPlayQueueItem> playlist, int playingItemIndex, long startPositionTicks, bool isPlaying, GroupShuffleMode shuffleMode, GroupRepeatMode repeatMode)
{
Reason = reason;
LastUpdate = lastUpdate;
Playlist = playlist;
PlayingItemIndex = playingItemIndex;
StartPositionTicks = startPositionTicks;
IsPlaying = isPlaying;
ShuffleMode = shuffleMode;
RepeatMode = repeatMode;
}
/// <summary>
/// Gets the request type that originated this update.
/// </summary>
/// <value>The reason for the update.</value>
public PlayQueueUpdateReason Reason { get; }
/// <summary>
/// Gets the UTC time of the last change to the playing queue.
/// </summary>
/// <value>The UTC time of the last change to the playing queue.</value>
public DateTime LastUpdate { get; }
/// <summary>
/// Gets the playlist.
/// </summary>
/// <value>The playlist.</value>
public IReadOnlyList<SyncPlayQueueItem> Playlist { get; }
/// <summary>
/// Gets the playing item index in the playlist.
/// </summary>
/// <value>The playing item index in the playlist.</value>
public int PlayingItemIndex { get; }
/// <summary>
/// Gets the start position ticks.
/// </summary>
/// <value>The start position ticks.</value>
public long StartPositionTicks { get; }
/// <summary>
/// Gets a value indicating whether the current item is playing.
/// </summary>
/// <value>The playing item status.</value>
public bool IsPlaying { get; }
/// <summary>
/// Gets the shuffle mode.
/// </summary>
/// <value>The shuffle mode.</value>
public GroupShuffleMode ShuffleMode { get; }
/// <summary>
/// Gets the repeat mode.
/// </summary>
/// <value>The repeat mode.</value>
public GroupRepeatMode RepeatMode { get; }
}
}
@@ -0,0 +1,58 @@
namespace MediaBrowser.Model.SyncPlay
{
/// <summary>
/// Enum PlayQueueUpdateReason.
/// </summary>
public enum PlayQueueUpdateReason
{
/// <summary>
/// A user is requesting to play a new playlist.
/// </summary>
NewPlaylist = 0,
/// <summary>
/// A user is changing the playing item.
/// </summary>
SetCurrentItem = 1,
/// <summary>
/// A user is removing items from the playlist.
/// </summary>
RemoveItems = 2,
/// <summary>
/// A user is moving an item in the playlist.
/// </summary>
MoveItem = 3,
/// <summary>
/// A user is adding items the queue.
/// </summary>
Queue = 4,
/// <summary>
/// A user is adding items to the queue, after the currently playing item.
/// </summary>
QueueNext = 5,
/// <summary>
/// A user is requesting the next item in queue.
/// </summary>
NextItem = 6,
/// <summary>
/// A user is requesting the previous item in queue.
/// </summary>
PreviousItem = 7,
/// <summary>
/// A user is changing repeat mode.
/// </summary>
RepeatMode = 8,
/// <summary>
/// A user is changing shuffle mode.
/// </summary>
ShuffleMode = 9
}
}
@@ -0,0 +1,93 @@
namespace MediaBrowser.Model.SyncPlay
{
/// <summary>
/// Enum PlaybackRequestType.
/// </summary>
public enum PlaybackRequestType
{
/// <summary>
/// A user is setting a new playlist.
/// </summary>
Play = 0,
/// <summary>
/// A user is changing the playlist item.
/// </summary>
SetPlaylistItem = 1,
/// <summary>
/// A user is removing items from the playlist.
/// </summary>
RemoveFromPlaylist = 2,
/// <summary>
/// A user is moving an item in the playlist.
/// </summary>
MovePlaylistItem = 3,
/// <summary>
/// A user is adding items to the playlist.
/// </summary>
Queue = 4,
/// <summary>
/// A user is requesting an unpause command for the group.
/// </summary>
Unpause = 5,
/// <summary>
/// A user is requesting a pause command for the group.
/// </summary>
Pause = 6,
/// <summary>
/// A user is requesting a stop command for the group.
/// </summary>
Stop = 7,
/// <summary>
/// A user is requesting a seek command for the group.
/// </summary>
Seek = 8,
/// <summary>
/// A user is signaling that playback is buffering.
/// </summary>
Buffer = 9,
/// <summary>
/// A user is signaling that playback resumed.
/// </summary>
Ready = 10,
/// <summary>
/// A user is requesting next item in playlist.
/// </summary>
NextItem = 11,
/// <summary>
/// A user is requesting previous item in playlist.
/// </summary>
PreviousItem = 12,
/// <summary>
/// A user is setting the repeat mode.
/// </summary>
SetRepeatMode = 13,
/// <summary>
/// A user is setting the shuffle mode.
/// </summary>
SetShuffleMode = 14,
/// <summary>
/// A user is reporting their ping.
/// </summary>
Ping = 15,
/// <summary>
/// A user is requesting to be ignored on group wait.
/// </summary>
IgnoreWait = 16
}
}
@@ -0,0 +1,33 @@
namespace MediaBrowser.Model.SyncPlay
{
/// <summary>
/// Enum RequestType.
/// </summary>
public enum RequestType
{
/// <summary>
/// A user is requesting to create a new group.
/// </summary>
NewGroup = 0,
/// <summary>
/// A user is requesting to join a group.
/// </summary>
JoinGroup = 1,
/// <summary>
/// A user is requesting to leave a group.
/// </summary>
LeaveGroup = 2,
/// <summary>
/// A user is requesting the list of available groups.
/// </summary>
ListGroups = 3,
/// <summary>
/// A user is sending a playback command to a group.
/// </summary>
Playback = 4
}
}
@@ -0,0 +1,65 @@
using System;
namespace MediaBrowser.Model.SyncPlay
{
/// <summary>
/// Class SendCommand.
/// </summary>
public class SendCommand
{
/// <summary>
/// Initializes a new instance of the <see cref="SendCommand"/> class.
/// </summary>
/// <param name="groupId">The group identifier.</param>
/// <param name="playlistItemId">The playlist identifier of the playing item.</param>
/// <param name="when">The UTC time when to execute the command.</param>
/// <param name="command">The command.</param>
/// <param name="positionTicks">The position ticks, for commands that require it.</param>
/// <param name="emittedAt">The UTC time when this command has been emitted.</param>
public SendCommand(Guid groupId, Guid playlistItemId, DateTime when, SendCommandType command, long? positionTicks, DateTime emittedAt)
{
GroupId = groupId;
PlaylistItemId = playlistItemId;
When = when;
Command = command;
PositionTicks = positionTicks;
EmittedAt = emittedAt;
}
/// <summary>
/// Gets the group identifier.
/// </summary>
/// <value>The group identifier.</value>
public Guid GroupId { get; }
/// <summary>
/// Gets the playlist identifier of the playing item.
/// </summary>
/// <value>The playlist identifier of the playing item.</value>
public Guid PlaylistItemId { get; }
/// <summary>
/// Gets or sets the UTC time when to execute the command.
/// </summary>
/// <value>The UTC time when to execute the command.</value>
public DateTime When { get; set; }
/// <summary>
/// Gets the position ticks.
/// </summary>
/// <value>The position ticks.</value>
public long? PositionTicks { get; }
/// <summary>
/// Gets the command.
/// </summary>
/// <value>The command.</value>
public SendCommandType Command { get; }
/// <summary>
/// Gets the UTC time when this command has been emitted.
/// </summary>
/// <value>The UTC time when this command has been emitted.</value>
public DateTime EmittedAt { get; }
}
}
@@ -0,0 +1,28 @@
namespace MediaBrowser.Model.SyncPlay
{
/// <summary>
/// Enum SendCommandType.
/// </summary>
public enum SendCommandType
{
/// <summary>
/// The unpause command. Instructs users to unpause playback.
/// </summary>
Unpause = 0,
/// <summary>
/// The pause command. Instructs users to pause playback.
/// </summary>
Pause = 1,
/// <summary>
/// The stop command. Instructs users to stop playback.
/// </summary>
Stop = 2,
/// <summary>
/// The seek command. Instructs users to seek to a specified time.
/// </summary>
Seek = 3
}
}
@@ -0,0 +1,28 @@
namespace MediaBrowser.Model.SyncPlay
{
/// <summary>
/// Used to filter the sessions of a group.
/// </summary>
public enum SyncPlayBroadcastType
{
/// <summary>
/// All sessions will receive the message.
/// </summary>
AllGroup = 0,
/// <summary>
/// Only the specified session will receive the message.
/// </summary>
CurrentSession = 1,
/// <summary>
/// All sessions, except the current one, will receive the message.
/// </summary>
AllExceptCurrentSession = 2,
/// <summary>
/// Only sessions that are not buffering will receive the message.
/// </summary>
AllReady = 3
}
}
@@ -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;
}
@@ -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;
}
@@ -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;
}
@@ -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;
}
@@ -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;
}
@@ -0,0 +1,31 @@
using System;
namespace MediaBrowser.Model.SyncPlay
{
/// <summary>
/// Class QueueItem.
/// </summary>
public class SyncPlayQueueItem
{
/// <summary>
/// Initializes a new instance of the <see cref="SyncPlayQueueItem"/> class.
/// </summary>
/// <param name="itemId">The item identifier.</param>
public SyncPlayQueueItem(Guid itemId)
{
ItemId = itemId;
}
/// <summary>
/// Gets the item identifier.
/// </summary>
/// <value>The item identifier.</value>
public Guid ItemId { get; }
/// <summary>
/// Gets the playlist identifier of the item.
/// </summary>
/// <value>The playlist identifier of the item.</value>
public Guid PlaylistItemId { get; } = Guid.NewGuid();
}
}
@@ -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;
}
@@ -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;
}
@@ -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;
}
@@ -0,0 +1,33 @@
using System;
namespace MediaBrowser.Model.SyncPlay
{
/// <summary>
/// Class UtcTimeResponse.
/// </summary>
public class UtcTimeResponse
{
/// <summary>
/// Initializes a new instance of the <see cref="UtcTimeResponse"/> class.
/// </summary>
/// <param name="requestReceptionTime">The UTC time when request has been received.</param>
/// <param name="responseTransmissionTime">The UTC time when response has been sent.</param>
public UtcTimeResponse(DateTime requestReceptionTime, DateTime responseTransmissionTime)
{
RequestReceptionTime = requestReceptionTime;
ResponseTransmissionTime = responseTransmissionTime;
}
/// <summary>
/// Gets the UTC time when request has been received.
/// </summary>
/// <value>The UTC time when request has been received.</value>
public DateTime RequestReceptionTime { get; }
/// <summary>
/// Gets the UTC time when response has been sent.
/// </summary>
/// <value>The UTC time when response has been sent.</value>
public DateTime ResponseTransmissionTime { get; }
}
}