|
|
@ -11,6 +11,7 @@ using NzbDrone.Common.Composition;
|
|
|
|
using NzbDrone.Common.Serializer;
|
|
|
|
using NzbDrone.Common.Serializer;
|
|
|
|
using NzbDrone.Common.TPL;
|
|
|
|
using NzbDrone.Common.TPL;
|
|
|
|
using NzbDrone.Core.Datastore.Events;
|
|
|
|
using NzbDrone.Core.Datastore.Events;
|
|
|
|
|
|
|
|
using NzbDrone.Core.MediaFiles.EpisodeImport.Manual;
|
|
|
|
using NzbDrone.Core.Messaging.Commands;
|
|
|
|
using NzbDrone.Core.Messaging.Commands;
|
|
|
|
using NzbDrone.Core.Messaging.Events;
|
|
|
|
using NzbDrone.Core.Messaging.Events;
|
|
|
|
using NzbDrone.Core.ProgressMessaging;
|
|
|
|
using NzbDrone.Core.ProgressMessaging;
|
|
|
@ -61,6 +62,9 @@ namespace Lidarr.Api.V1.Commands
|
|
|
|
using (var reader = new StreamReader(Request.Body))
|
|
|
|
using (var reader = new StreamReader(Request.Body))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var body = reader.ReadToEnd();
|
|
|
|
var body = reader.ReadToEnd();
|
|
|
|
|
|
|
|
var priority = commandType == typeof(ManualImportCommand)
|
|
|
|
|
|
|
|
? CommandPriority.High
|
|
|
|
|
|
|
|
: CommandPriority.Normal;
|
|
|
|
|
|
|
|
|
|
|
|
dynamic command = STJson.Deserialize(body, commandType);
|
|
|
|
dynamic command = STJson.Deserialize(body, commandType);
|
|
|
|
|
|
|
|
|
|
|
@ -69,7 +73,8 @@ namespace Lidarr.Api.V1.Commands
|
|
|
|
command.SendUpdatesToClient = true;
|
|
|
|
command.SendUpdatesToClient = true;
|
|
|
|
command.ClientUserAgent = Request.Headers["UserAgent"];
|
|
|
|
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);
|
|
|
|
return Created(trackedCommand.Id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|