2016-12-23 21:45:24 +00:00
|
|
|
|
using FluentValidation;
|
2014-02-14 05:31:49 +00:00
|
|
|
|
using NzbDrone.Core.Annotations;
|
|
|
|
|
using NzbDrone.Core.ThingiProvider;
|
2015-03-17 04:33:34 +00:00
|
|
|
|
using NzbDrone.Core.Validation;
|
2014-02-16 09:56:12 +00:00
|
|
|
|
using NzbDrone.Core.Validation.Paths;
|
2014-02-14 05:31:49 +00:00
|
|
|
|
|
2014-04-19 15:09:22 +00:00
|
|
|
|
namespace NzbDrone.Core.Download.Clients.Pneumatic
|
2014-02-14 05:31:49 +00:00
|
|
|
|
{
|
2014-05-25 21:58:41 +00:00
|
|
|
|
public class PneumaticSettingsValidator : AbstractValidator<PneumaticSettings>
|
2014-02-14 05:31:49 +00:00
|
|
|
|
{
|
2014-05-25 21:58:41 +00:00
|
|
|
|
public PneumaticSettingsValidator()
|
2014-02-14 05:31:49 +00:00
|
|
|
|
{
|
2014-05-25 21:58:41 +00:00
|
|
|
|
RuleFor(c => c.NzbFolder).IsValidPath();
|
2014-09-01 16:24:17 +00:00
|
|
|
|
RuleFor(c => c.StrmFolder).IsValidPath();
|
2014-02-14 05:31:49 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-05-25 21:58:41 +00:00
|
|
|
|
public class PneumaticSettings : IProviderConfig
|
2014-02-14 05:31:49 +00:00
|
|
|
|
{
|
2014-05-25 21:58:41 +00:00
|
|
|
|
private static readonly PneumaticSettingsValidator Validator = new PneumaticSettingsValidator();
|
2014-02-14 05:31:49 +00:00
|
|
|
|
|
2014-09-01 16:24:17 +00:00
|
|
|
|
[FieldDefinition(0, Label = "Nzb Folder", Type = FieldType.Path, HelpText = "This folder will need to be reachable from XBMC")]
|
2015-10-03 17:45:26 +00:00
|
|
|
|
public string NzbFolder { get; set; }
|
2014-02-14 05:31:49 +00:00
|
|
|
|
|
2014-09-01 16:24:17 +00:00
|
|
|
|
[FieldDefinition(1, Label = "Strm Folder", Type = FieldType.Path, HelpText = ".strm files in this folder will be import by drone")]
|
2015-10-03 17:45:26 +00:00
|
|
|
|
public string StrmFolder { get; set; }
|
2014-09-01 16:24:17 +00:00
|
|
|
|
|
2015-03-17 04:33:34 +00:00
|
|
|
|
public NzbDroneValidationResult Validate()
|
2014-02-14 05:31:49 +00:00
|
|
|
|
{
|
2015-03-17 04:33:34 +00:00
|
|
|
|
return new NzbDroneValidationResult(Validator.Validate(this));
|
2014-02-14 05:31:49 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|