mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-16 10:03:51 -07:00
fixed service registration for event handlers and executors.
This commit is contained in:
parent
399c96c5e3
commit
fa8f67d7fe
12 changed files with 190 additions and 95 deletions
|
@ -23,13 +23,13 @@ namespace NzbDrone.Api.Commands
|
|||
{
|
||||
var commandType = _commands.Single(c => c.GetType().Name.Replace("Command", "").Equals(resource.Command, StringComparison.InvariantCultureIgnoreCase))
|
||||
.GetType();
|
||||
var command = (object)Request.Body.FromJson<ICommand>(commandType);
|
||||
var method = typeof(IMessageAggregator).GetMethod("PublishCommand");
|
||||
var genericMethod = method.MakeGenericMethod(commandType);
|
||||
genericMethod.Invoke(_messageAggregator, new[] { command });
|
||||
|
||||
|
||||
var command = Request.Body.FromJson<ICommand>(commandType);
|
||||
|
||||
_messageAggregator.PublishCommand(command);
|
||||
|
||||
return resource;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue