You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
944 B
32 lines
944 B
using System.Collections.Generic;
|
|
using NzbDrone.Core.Datastore.Events;
|
|
using NzbDrone.Core.Download;
|
|
using NzbDrone.Core.Messaging.Commands;
|
|
using NzbDrone.Core.Messaging.Events;
|
|
using NzbDrone.Core.Queue;
|
|
|
|
namespace NzbDrone.Api.Queue
|
|
{
|
|
public class QueueModule : NzbDroneRestModuleWithSignalR<QueueResource, Core.Queue.Queue>,
|
|
IHandle<UpdateQueueEvent>
|
|
{
|
|
private readonly IQueueService _queueService;
|
|
|
|
public QueueModule(ICommandExecutor commandExecutor, IQueueService queueService)
|
|
: base(commandExecutor)
|
|
{
|
|
_queueService = queueService;
|
|
GetResourceAll = GetQueue;
|
|
}
|
|
|
|
private List<QueueResource> GetQueue()
|
|
{
|
|
return ToListResource(_queueService.GetQueue);
|
|
}
|
|
|
|
public void Handle(UpdateQueueEvent message)
|
|
{
|
|
BroadcastResourceChange(ModelAction.Sync);
|
|
}
|
|
}
|
|
} |