mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-19 21:44:30 -04:00
Fixed: Schedule refresh and process monitored download tasks at high priority
Fixes #1542 Fixes #1553 Fixes #1537
This commit is contained in:
@@ -27,6 +27,8 @@ namespace Readarr.Api.V1.Commands
|
||||
private readonly Debouncer _debouncer;
|
||||
private readonly Dictionary<int, CommandResource> _pendingUpdates;
|
||||
|
||||
private readonly CommandPriorityComparer _commandPriorityComparer = new CommandPriorityComparer();
|
||||
|
||||
public CommandController(IManageCommandQueue commandQueueManager,
|
||||
IBroadcastSignalRMessage signalRBroadcaster,
|
||||
KnownTypes knownTypes)
|
||||
@@ -35,10 +37,10 @@ namespace Readarr.Api.V1.Commands
|
||||
_commandQueueManager = commandQueueManager;
|
||||
_knownTypes = knownTypes;
|
||||
|
||||
PostValidator.RuleFor(c => c.Name).NotBlank();
|
||||
|
||||
_debouncer = new Debouncer(SendUpdates, TimeSpan.FromSeconds(0.1));
|
||||
_pendingUpdates = new Dictionary<int, CommandResource>();
|
||||
|
||||
PostValidator.RuleFor(c => c.Name).NotBlank();
|
||||
}
|
||||
|
||||
protected override CommandResource GetResourceById(int id)
|
||||
@@ -72,7 +74,10 @@ namespace Readarr.Api.V1.Commands
|
||||
[HttpGet]
|
||||
public List<CommandResource> GetStartedCommands()
|
||||
{
|
||||
return _commandQueueManager.All().ToResource();
|
||||
return _commandQueueManager.All()
|
||||
.OrderBy(c => c.Status, _commandPriorityComparer)
|
||||
.ThenByDescending(c => c.Priority)
|
||||
.ToResource();
|
||||
}
|
||||
|
||||
[RestDeleteById]
|
||||
|
||||
Reference in New Issue
Block a user