mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
fixed diskscan
removed all stored status fields from episode
This commit is contained in:
parent
feb947fb74
commit
cbe4be814c
32 changed files with 295 additions and 286 deletions
|
@ -2,6 +2,7 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using NzbDrone.Api.Extensions;
|
||||
using NzbDrone.Common.Composition;
|
||||
using NzbDrone.Common.Messaging;
|
||||
|
||||
namespace NzbDrone.Api.Commands
|
||||
|
@ -9,20 +10,22 @@ namespace NzbDrone.Api.Commands
|
|||
public class CommandModule : NzbDroneRestModule<CommandResource>
|
||||
{
|
||||
private readonly IMessageAggregator _messageAggregator;
|
||||
private readonly IEnumerable<ICommand> _commands;
|
||||
private readonly IContainer _container;
|
||||
|
||||
public CommandModule(IMessageAggregator messageAggregator, IEnumerable<ICommand> commands)
|
||||
public CommandModule(IMessageAggregator messageAggregator, IContainer container)
|
||||
{
|
||||
_messageAggregator = messageAggregator;
|
||||
_commands = commands;
|
||||
_container = container;
|
||||
|
||||
CreateResource = RunCommand;
|
||||
}
|
||||
|
||||
private CommandResource RunCommand(CommandResource resource)
|
||||
{
|
||||
var commandType = _commands.Single(c => c.GetType().Name.Replace("Command", "").Equals(resource.Command, StringComparison.InvariantCultureIgnoreCase))
|
||||
.GetType();
|
||||
var commandType =
|
||||
_container.GetImplementations(typeof(ICommand))
|
||||
.Single(c => c.Name.Replace("Command", "")
|
||||
.Equals(resource.Command, StringComparison.InvariantCultureIgnoreCase));
|
||||
|
||||
|
||||
var command = Request.Body.FromJson<ICommand>(commandType);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue