|
|
|
@ -7,6 +7,7 @@ using NzbDrone.Common.Composition;
|
|
|
|
|
using NzbDrone.Common.Serializer;
|
|
|
|
|
using NzbDrone.Common.TPL;
|
|
|
|
|
using NzbDrone.Core.Datastore.Events;
|
|
|
|
|
using NzbDrone.Core.MediaFiles.BookImport.Manual;
|
|
|
|
|
using NzbDrone.Core.Messaging.Commands;
|
|
|
|
|
using NzbDrone.Core.Messaging.Events;
|
|
|
|
|
using NzbDrone.Core.ProgressMessaging;
|
|
|
|
@ -58,6 +59,9 @@ namespace Readarr.Api.V1.Commands
|
|
|
|
|
Request.Body.Seek(0, SeekOrigin.Begin);
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
@ -66,7 +70,8 @@ namespace Readarr.Api.V1.Commands
|
|
|
|
|
command.SendUpdatesToClient = true;
|
|
|
|
|
command.ClientUserAgent = Request.Headers["User-Agent"];
|
|
|
|
|
|
|
|
|
|
var trackedCommand = _commandQueueManager.Push(command, CommandPriority.Normal, CommandTrigger.Manual);
|
|
|
|
|
var trackedCommand = _commandQueueManager.Push(command, priority, CommandTrigger.Manual);
|
|
|
|
|
|
|
|
|
|
return Created(trackedCommand.Id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|