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>
|
|
|
|
public class RemoveFromPlaylistGroupRequest : IGroupPlaybackRequest
|
|
|
|
{
|
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-11-28 13:19:24 +00:00
|
|
|
public RemoveFromPlaylistGroupRequest(IReadOnlyList<string> items)
|
2020-11-14 22:40:01 +00:00
|
|
|
{
|
2020-11-15 16:03:27 +00:00
|
|
|
PlaylistItemIds = items ?? Array.Empty<string>();
|
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-11-14 22:40:01 +00:00
|
|
|
public IReadOnlyList<string> PlaylistItemIds { get; }
|
2020-11-13 14:13:32 +00:00
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
public PlaybackRequestType Type { get; } = PlaybackRequestType.RemoveFromPlaylist;
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
public void Apply(IGroupStateContext context, IGroupState state, SessionInfo session, CancellationToken cancellationToken)
|
|
|
|
{
|
|
|
|
state.HandleRequest(context, state.Type, this, session, cancellationToken);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|