RemoveFromPlaylistGroupRequest.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #nullable disable
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Threading;
  5. using MediaBrowser.Controller.Session;
  6. using MediaBrowser.Model.SyncPlay;
  7. namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
  8. {
  9. /// <summary>
  10. /// Class RemoveFromPlaylistGroupRequest.
  11. /// </summary>
  12. public class RemoveFromPlaylistGroupRequest : AbstractPlaybackRequest
  13. {
  14. /// <summary>
  15. /// Initializes a new instance of the <see cref="RemoveFromPlaylistGroupRequest"/> class.
  16. /// </summary>
  17. /// <param name="items">The playlist ids of the items to remove.</param>
  18. public RemoveFromPlaylistGroupRequest(IReadOnlyList<Guid> items)
  19. {
  20. PlaylistItemIds = items ?? Array.Empty<Guid>();
  21. }
  22. /// <summary>
  23. /// Gets the playlist identifiers ot the items.
  24. /// </summary>
  25. /// <value>The playlist identifiers ot the items.</value>
  26. public IReadOnlyList<Guid> PlaylistItemIds { get; }
  27. /// <inheritdoc />
  28. public override PlaybackRequestType Action { get; } = PlaybackRequestType.RemoveFromPlaylist;
  29. /// <inheritdoc />
  30. public override void Apply(IGroupStateContext context, IGroupState state, SessionInfo session, CancellationToken cancellationToken)
  31. {
  32. state.HandleRequest(this, context, state.Type, session, cancellationToken);
  33. }
  34. }
  35. }