Move query parameters to request body in SyncPlay

This commit is contained in:
Ionut Andrei Oanca
2020-11-28 14:19:24 +01:00
parent ba78ad5424
commit c60714e365
26 changed files with 475 additions and 136 deletions

View File

@@ -1,25 +0,0 @@
using System;
namespace MediaBrowser.Model.SyncPlay
{
/// <summary>
/// Class JoinGroupRequest.
/// </summary>
public class JoinGroupRequest
{
/// <summary>
/// Initializes a new instance of the <see cref="JoinGroupRequest"/> class.
/// </summary>
/// <param name="groupId">The identifier of the group to join.</param>
public JoinGroupRequest(Guid groupId)
{
GroupId = groupId;
}
/// <summary>
/// Gets the group identifier.
/// </summary>
/// <value>The identifier of the group to join.</value>
public Guid GroupId { get; }
}
}

View File

@@ -1,23 +0,0 @@
namespace MediaBrowser.Model.SyncPlay
{
/// <summary>
/// Class NewGroupRequest.
/// </summary>
public class NewGroupRequest
{
/// <summary>
/// Initializes a new instance of the <see cref="NewGroupRequest"/> class.
/// </summary>
/// <param name="groupName">The name of the new group.</param>
public NewGroupRequest(string groupName)
{
GroupName = groupName;
}
/// <summary>
/// Gets the group name.
/// </summary>
/// <value>The name of the new group.</value>
public string GroupName { get; }
}
}

View File

@@ -0,0 +1,42 @@
using System;
namespace MediaBrowser.Model.SyncPlay.RequestBodies
{
/// <summary>
/// Class BufferRequestBody.
/// </summary>
public class BufferRequestBody
{
/// <summary>
/// Initializes a new instance of the <see cref="BufferRequestBody"/> class.
/// </summary>
public BufferRequestBody()
{
PlaylistItemId = string.Empty;
}
/// <summary>
/// Gets or sets when the request has been made by the client.
/// </summary>
/// <value>The date of the request.</value>
public DateTime When { get; set; }
/// <summary>
/// Gets or sets the position ticks.
/// </summary>
/// <value>The position ticks.</value>
public long PositionTicks { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the client playback is unpaused.
/// </summary>
/// <value>The client playback status.</value>
public bool IsPlaying { get; set; }
/// <summary>
/// Gets or sets the playlist item identifier of the playing item.
/// </summary>
/// <value>The playlist item identifier.</value>
public string PlaylistItemId { get; set; }
}
}

View File

@@ -0,0 +1,14 @@
namespace MediaBrowser.Model.SyncPlay.RequestBodies
{
/// <summary>
/// Class IgnoreWaitRequestBody.
/// </summary>
public class IgnoreWaitRequestBody
{
/// <summary>
/// Gets or sets a value indicating whether the client should be ignored.
/// </summary>
/// <value>The client group-wait status.</value>
public bool IgnoreWait { get; set; }
}
}

View File

@@ -0,0 +1,16 @@
using System;
namespace MediaBrowser.Model.SyncPlay.RequestBodies
{
/// <summary>
/// Class JoinGroupRequestBody.
/// </summary>
public class JoinGroupRequestBody
{
/// <summary>
/// Gets or sets the group identifier.
/// </summary>
/// <value>The identifier of the group to join.</value>
public Guid GroupId { get; set; }
}
}

View File

@@ -0,0 +1,28 @@
namespace MediaBrowser.Model.SyncPlay.RequestBodies
{
/// <summary>
/// Class MovePlaylistItemRequestBody.
/// </summary>
public class MovePlaylistItemRequestBody
{
/// <summary>
/// Initializes a new instance of the <see cref="MovePlaylistItemRequestBody"/> class.
/// </summary>
public MovePlaylistItemRequestBody()
{
PlaylistItemId = string.Empty;
}
/// <summary>
/// Gets or sets the playlist identifier of the item.
/// </summary>
/// <value>The playlist identifier of the item.</value>
public string PlaylistItemId { get; set; }
/// <summary>
/// Gets or sets the new position.
/// </summary>
/// <value>The new position.</value>
public int NewIndex { get; set; }
}
}

View File

@@ -0,0 +1,22 @@
namespace MediaBrowser.Model.SyncPlay.RequestBodies
{
/// <summary>
/// Class NewGroupRequestBody.
/// </summary>
public class NewGroupRequestBody
{
/// <summary>
/// Initializes a new instance of the <see cref="NewGroupRequestBody"/> class.
/// </summary>
public NewGroupRequestBody()
{
GroupName = string.Empty;
}
/// <summary>
/// Gets or sets the group name.
/// </summary>
/// <value>The name of the new group.</value>
public string GroupName { get; set; }
}
}

View File

@@ -0,0 +1,22 @@
namespace MediaBrowser.Model.SyncPlay.RequestBodies
{
/// <summary>
/// Class NextTrackRequestBody.
/// </summary>
public class NextTrackRequestBody
{
/// <summary>
/// Initializes a new instance of the <see cref="NextTrackRequestBody"/> class.
/// </summary>
public NextTrackRequestBody()
{
PlaylistItemId = string.Empty;
}
/// <summary>
/// Gets or sets the playing item identifier.
/// </summary>
/// <value>The playing item identifier.</value>
public string PlaylistItemId { get; set; }
}
}

View File

@@ -0,0 +1,14 @@
namespace MediaBrowser.Model.SyncPlay.RequestBodies
{
/// <summary>
/// Class PingRequestBody.
/// </summary>
public class PingRequestBody
{
/// <summary>
/// Gets or sets the ping time.
/// </summary>
/// <value>The ping time.</value>
public long Ping { get; set; }
}
}

View File

@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
namespace MediaBrowser.Model.SyncPlay.RequestBodies
{
/// <summary>
/// Class PlayRequestBody.
/// </summary>
public class PlayRequestBody
{
/// <summary>
/// Initializes a new instance of the <see cref="PlayRequestBody"/> class.
/// </summary>
public PlayRequestBody()
{
PlayingQueue = Array.Empty<Guid>();
}
/// <summary>
/// Gets or sets the playing queue.
/// </summary>
/// <value>The playing queue.</value>
public IReadOnlyList<Guid> PlayingQueue { get; set; }
/// <summary>
/// Gets or sets the position of the playing item in the queue.
/// </summary>
/// <value>The playing item position.</value>
public int PlayingItemPosition { get; set; }
/// <summary>
/// Gets or sets the start position ticks.
/// </summary>
/// <value>The start position ticks.</value>
public long StartPositionTicks { get; set; }
}
}

View File

@@ -0,0 +1,22 @@
namespace MediaBrowser.Model.SyncPlay.RequestBodies
{
/// <summary>
/// Class PreviousTrackRequestBody.
/// </summary>
public class PreviousTrackRequestBody
{
/// <summary>
/// Initializes a new instance of the <see cref="PreviousTrackRequestBody"/> class.
/// </summary>
public PreviousTrackRequestBody()
{
PlaylistItemId = string.Empty;
}
/// <summary>
/// Gets or sets the playing item identifier.
/// </summary>
/// <value>The playing item identifier.</value>
public string PlaylistItemId { get; set; }
}
}

View File

@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
namespace MediaBrowser.Model.SyncPlay.RequestBodies
{
/// <summary>
/// Class QueueRequestBody.
/// </summary>
public class QueueRequestBody
{
/// <summary>
/// Initializes a new instance of the <see cref="QueueRequestBody"/> class.
/// </summary>
public QueueRequestBody()
{
ItemIds = Array.Empty<Guid>();
}
/// <summary>
/// Gets or sets the items to enqueue.
/// </summary>
/// <value>The items to enqueue.</value>
public IReadOnlyList<Guid> ItemIds { get; set; }
/// <summary>
/// Gets or sets the mode in which to add the new items.
/// </summary>
/// <value>The enqueue mode.</value>
public GroupQueueMode Mode { get; set; }
}
}

View File

@@ -0,0 +1,42 @@
using System;
namespace MediaBrowser.Model.SyncPlay.RequestBodies
{
/// <summary>
/// Class ReadyRequest.
/// </summary>
public class ReadyRequestBody
{
/// <summary>
/// Initializes a new instance of the <see cref="ReadyRequestBody"/> class.
/// </summary>
public ReadyRequestBody()
{
PlaylistItemId = string.Empty;
}
/// <summary>
/// Gets or sets when the request has been made by the client.
/// </summary>
/// <value>The date of the request.</value>
public DateTime When { get; set; }
/// <summary>
/// Gets or sets the position ticks.
/// </summary>
/// <value>The position ticks.</value>
public long PositionTicks { get; set; }
/// <summary>
/// Gets or sets a value indicating whether the client playback is unpaused.
/// </summary>
/// <value>The client playback status.</value>
public bool IsPlaying { get; set; }
/// <summary>
/// Gets or sets the playlist item identifier of the playing item.
/// </summary>
/// <value>The playlist item identifier.</value>
public string PlaylistItemId { get; set; }
}
}

View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
namespace MediaBrowser.Model.SyncPlay.RequestBodies
{
/// <summary>
/// Class RemoveFromPlaylistRequestBody.
/// </summary>
public class RemoveFromPlaylistRequestBody
{
/// <summary>
/// Initializes a new instance of the <see cref="RemoveFromPlaylistRequestBody"/> class.
/// </summary>
public RemoveFromPlaylistRequestBody()
{
PlaylistItemIds = Array.Empty<string>();
}
/// <summary>
/// Gets or sets the playlist identifiers ot the items.
/// </summary>
/// <value>The playlist identifiers ot the items.</value>
public IReadOnlyList<string> PlaylistItemIds { get; set; }
}
}

View File

@@ -0,0 +1,14 @@
namespace MediaBrowser.Model.SyncPlay.RequestBodies
{
/// <summary>
/// Class SeekRequestBody.
/// </summary>
public class SeekRequestBody
{
/// <summary>
/// Gets or sets the position ticks.
/// </summary>
/// <value>The position ticks.</value>
public long PositionTicks { get; set; }
}
}

View File

@@ -0,0 +1,22 @@
namespace MediaBrowser.Model.SyncPlay.RequestBodies
{
/// <summary>
/// Class SetPlaylistItemRequestBody.
/// </summary>
public class SetPlaylistItemRequestBody
{
/// <summary>
/// Initializes a new instance of the <see cref="SetPlaylistItemRequestBody"/> class.
/// </summary>
public SetPlaylistItemRequestBody()
{
PlaylistItemId = string.Empty;
}
/// <summary>
/// Gets or sets the playlist identifier of the playing item.
/// </summary>
/// <value>The playlist identifier of the playing item.</value>
public string PlaylistItemId { get; set; }
}
}

View File

@@ -0,0 +1,14 @@
namespace MediaBrowser.Model.SyncPlay.RequestBodies
{
/// <summary>
/// Class SetRepeatModeRequestBody.
/// </summary>
public class SetRepeatModeRequestBody
{
/// <summary>
/// Gets or sets the repeat mode.
/// </summary>
/// <value>The repeat mode.</value>
public GroupRepeatMode Mode { get; set; }
}
}

View File

@@ -0,0 +1,14 @@
namespace MediaBrowser.Model.SyncPlay.RequestBodies
{
/// <summary>
/// Class SetShuffleModeRequestBody.
/// </summary>
public class SetShuffleModeRequestBody
{
/// <summary>
/// Gets or sets the shuffle mode.
/// </summary>
/// <value>The shuffle mode.</value>
public GroupShuffleMode Mode { get; set; }
}
}