jellyfin-server/MediaBrowser.Controller/SyncPlay/PlaybackRequests/MovePlaylistItemGroupRequest.cs

46 lines
1.5 KiB
C#
Raw Normal View History

2020-12-04 19:15:16 +00:00
using System;
using System.Threading;
using MediaBrowser.Controller.Session;
using MediaBrowser.Model.SyncPlay;
namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
{
/// <summary>
/// Class MovePlaylistItemGroupRequest.
/// </summary>
public class MovePlaylistItemGroupRequest : AbstractPlaybackRequest
{
/// <summary>
/// Initializes a new instance of the <see cref="MovePlaylistItemGroupRequest"/> class.
/// </summary>
/// <param name="playlistItemId">The playlist identifier of the item.</param>
/// <param name="newIndex">The new position.</param>
2020-12-04 19:15:16 +00:00
public MovePlaylistItemGroupRequest(Guid playlistItemId, int newIndex)
{
PlaylistItemId = playlistItemId;
NewIndex = newIndex;
}
/// <summary>
/// Gets the playlist identifier of the item.
/// </summary>
2020-10-21 14:42:57 +00:00
/// <value>The playlist identifier of the item.</value>
2020-12-04 19:15:16 +00:00
public Guid PlaylistItemId { get; }
/// <summary>
/// Gets the new position.
/// </summary>
/// <value>The new position.</value>
public int NewIndex { get; }
/// <inheritdoc />
public override PlaybackRequestType Action { get; } = PlaybackRequestType.MovePlaylistItem;
/// <inheritdoc />
public override void Apply(IGroupStateContext context, IGroupState state, SessionInfo session, CancellationToken cancellationToken)
{
2020-12-04 22:16:15 +00:00
state.HandleRequest(this, context, state.Type, session, cancellationToken);
}
}
}