1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-04 10:34:59 +02:00

Queue Manual Import commands at high priority

This commit is contained in:
Mark McDowall 2024-03-01 23:24:47 -08:00 committed by Mark McDowall
parent 7f061a9583
commit 64c6a8879b

View File

@ -7,6 +7,7 @@
using NzbDrone.Common.Serializer;
using NzbDrone.Common.TPL;
using NzbDrone.Core.Datastore.Events;
using NzbDrone.Core.MediaFiles.EpisodeImport.Manual;
using NzbDrone.Core.Messaging.Commands;
using NzbDrone.Core.Messaging.Events;
using NzbDrone.Core.ProgressMessaging;
@ -61,6 +62,9 @@ public ActionResult<CommandResource> StartCommand(CommandResource commandResourc
using (var reader = new StreamReader(Request.Body))
{
var body = reader.ReadToEnd();
var priority = commandType == typeof(ManualImportCommand)
? CommandPriority.High
: CommandPriority.Normal;
dynamic command = STJson.Deserialize(body, commandType);
@ -69,7 +73,8 @@ public ActionResult<CommandResource> StartCommand(CommandResource commandResourc
command.SendUpdatesToClient = true;
command.ClientUserAgent = Request.Headers["UserAgent"];
var trackedCommand = _commandQueueManager.Push(command, CommandPriority.Normal, CommandTrigger.Manual);
var trackedCommand = _commandQueueManager.Push(command, priority, CommandTrigger.Manual);
return Created(trackedCommand.Id);
}
}