MovePlaylistItemGroupRequest.cs 1.5 KB

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