1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2025-02-25 07:23:16 +00:00
Sonarr/NzbDrone.Api/Queue/QueueModule.cs
Mark McDowall daeb2fc652 Episode grid will show downloading on grab
New: Update episode status in UI on grab and download
2013-10-01 22:20:30 -07:00

32 lines
No EOL
944 B
C#

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);
}
}
}