MovePlaylistItemGroupRequest.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #nullable disable
  2. using System;
  3. using System.Threading;
  4. using MediaBrowser.Controller.Session;
  5. using MediaBrowser.Model.SyncPlay;
  6. namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
  7. {
  8. /// <summary>
  9. /// Class MovePlaylistItemGroupRequest.
  10. /// </summary>
  11. public class MovePlaylistItemGroupRequest : AbstractPlaybackRequest
  12. {
  13. /// <summary>
  14. /// Initializes a new instance of the <see cref="MovePlaylistItemGroupRequest"/> class.
  15. /// </summary>
  16. /// <param name="playlistItemId">The playlist identifier of the item.</param>
  17. /// <param name="newIndex">The new position.</param>
  18. public MovePlaylistItemGroupRequest(Guid playlistItemId, int newIndex)
  19. {
  20. PlaylistItemId = playlistItemId;
  21. NewIndex = newIndex;
  22. }
  23. /// <summary>
  24. /// Gets the playlist identifier of the item.
  25. /// </summary>
  26. /// <value>The playlist identifier of the item.</value>
  27. public Guid PlaylistItemId { get; }
  28. /// <summary>
  29. /// Gets the new position.
  30. /// </summary>
  31. /// <value>The new position.</value>
  32. public int NewIndex { get; }
  33. /// <inheritdoc />
  34. public override PlaybackRequestType Action { get; } = PlaybackRequestType.MovePlaylistItem;
  35. /// <inheritdoc />
  36. public override void Apply(IGroupStateContext context, IGroupState state, SessionInfo session, CancellationToken cancellationToken)
  37. {
  38. state.HandleRequest(this, context, state.Type, session, cancellationToken);
  39. }
  40. }
  41. }