RemoveFromPlaylistGroupRequest.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System;
  2. using System.Collections.Generic;
  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 RemoveFromPlaylistGroupRequest.
  10. /// </summary>
  11. public class RemoveFromPlaylistGroupRequest : AbstractPlaybackRequest
  12. {
  13. /// <summary>
  14. /// Initializes a new instance of the <see cref="RemoveFromPlaylistGroupRequest"/> class.
  15. /// </summary>
  16. /// <param name="items">The playlist ids of the items to remove.</param>
  17. public RemoveFromPlaylistGroupRequest(IReadOnlyList<Guid> items)
  18. {
  19. PlaylistItemIds = items ?? Array.Empty<Guid>();
  20. }
  21. /// <summary>
  22. /// Gets the playlist identifiers ot the items.
  23. /// </summary>
  24. /// <value>The playlist identifiers ot the items.</value>
  25. public IReadOnlyList<Guid> PlaylistItemIds { get; }
  26. /// <inheritdoc />
  27. public override PlaybackRequestType Action { get; } = PlaybackRequestType.RemoveFromPlaylist;
  28. /// <inheritdoc />
  29. public override void Apply(IGroupStateContext context, IGroupState state, SessionInfo session, CancellationToken cancellationToken)
  30. {
  31. state.HandleRequest(context, state.Type, this, session, cancellationToken);
  32. }
  33. }
  34. }