using System;
using System.Collections.Generic;
using System.Threading;
using MediaBrowser.Controller.Session;
using MediaBrowser.Model.SyncPlay;
namespace MediaBrowser.Controller.SyncPlay.PlaybackRequests
{
///
/// Class QueueGroupRequest.
///
public class QueueGroupRequest : AbstractPlaybackRequest
{
///
/// Initializes a new instance of the class.
///
/// The items to add to the queue.
/// The enqueue mode.
public QueueGroupRequest(IReadOnlyList items, GroupQueueMode mode)
{
ItemIds = items ?? Array.Empty();
Mode = mode;
}
///
/// Gets the items to enqueue.
///
/// The items to enqueue.
public IReadOnlyList ItemIds { get; }
///
/// Gets the mode in which to add the new items.
///
/// The enqueue mode.
public GroupQueueMode Mode { get; }
///
public override PlaybackRequestType Action { get; } = PlaybackRequestType.Queue;
///
public override void Apply(IGroupStateContext context, IGroupState state, SessionInfo session, CancellationToken cancellationToken)
{
state.HandleRequest(this, context, state.Type, session, cancellationToken);
}
}
}