Custom scripts

New: Run custom scripts (Connection)

Closes #439
This commit is contained in:
Mark McDowall
2015-05-20 16:22:10 -07:00
parent 492b114510
commit 0f2bba0615
42 changed files with 560 additions and 74 deletions

View File

@@ -0,0 +1,33 @@
using System;
using FluentValidation;
using NzbDrone.Core.Annotations;
using NzbDrone.Core.ThingiProvider;
using NzbDrone.Core.Validation;
using NzbDrone.Core.Validation.Paths;
namespace NzbDrone.Core.Notifications.CustomScript
{
public class CustomScriptSettingsValidator : AbstractValidator<CustomScriptSettings>
{
public CustomScriptSettingsValidator()
{
RuleFor(c => c.Path).IsValidPath();
}
}
public class CustomScriptSettings : IProviderConfig
{
private static readonly CustomScriptSettingsValidator Validator = new CustomScriptSettingsValidator();
[FieldDefinition(0, Label = "Path", Type = FieldType.Path)]
public String Path { get; set; }
[FieldDefinition(0, Label = "Arguments", HelpText = "Arguments to pass to the script")]
public String Arguments { get; set; }
public NzbDroneValidationResult Validate()
{
return new NzbDroneValidationResult(Validator.Validate(this));
}
}
}