2020-11-15 16:03:27 +00:00
|
|
|
using System;
|
2020-11-13 14:13:32 +00:00
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Threading;
|
|
|
|
using MediaBrowser.Controller.Session;
|
|
|
|
using MediaBrowser.Model.SyncPlay;
|
|
|
|
|
2020-11-14 22:40:01 +00:00
|
|
|
namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
|
2020-11-13 14:13:32 +00:00
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Class RemoveFromPlaylistGroupRequest.
|
|
|
|
/// </summary>
|
2020-11-28 15:03:02 +00:00
|
|
|
public class RemoveFromPlaylistGroupRequest : AbstractPlaybackRequest
|
2020-11-13 14:13:32 +00:00
|
|
|
{
|
2020-11-14 22:40:01 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Initializes a new instance of the <see cref="RemoveFromPlaylistGroupRequest"/> class.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="items">The playlist ids of the items to remove.</param>
|
2020-12-04 19:15:16 +00:00
|
|
|
public RemoveFromPlaylistGroupRequest(IReadOnlyList<Guid> items)
|
2020-11-14 22:40:01 +00:00
|
|
|
{
|
2020-12-04 19:15:16 +00:00
|
|
|
PlaylistItemIds = items ?? Array.Empty<Guid>();
|
2020-11-14 22:40:01 +00:00
|
|
|
}
|
|
|
|
|
2020-11-13 14:13:32 +00:00
|
|
|
/// <summary>
|
|
|
|
/// Gets the playlist identifiers ot the items.
|
|
|
|
/// </summary>
|
|
|
|
/// <value>The playlist identifiers ot the items.</value>
|
2020-12-04 19:15:16 +00:00
|
|
|
public IReadOnlyList<Guid> PlaylistItemIds { get; }
|
2020-11-13 14:13:32 +00:00
|
|
|
|
|
|
|
/// <inheritdoc />
|
2020-11-28 15:03:02 +00:00
|
|
|
public override PlaybackRequestType Action { get; } = PlaybackRequestType.RemoveFromPlaylist;
|
2020-11-13 14:13:32 +00:00
|
|
|
|
|
|
|
/// <inheritdoc />
|
2020-11-28 15:03:02 +00:00
|
|
|
public override void Apply(IGroupStateContext context, IGroupState state, SessionInfo session, CancellationToken cancellationToken)
|
2020-11-13 14:13:32 +00:00
|
|
|
{
|
2020-12-04 22:16:15 +00:00
|
|
|
state.HandleRequest(this, context, state.Type, session, cancellationToken);
|
2020-11-13 14:13:32 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|