2016-12-23 21:45:24 +00:00
|
|
|
|
using FluentValidation;
|
2014-04-19 15:09:22 +00:00
|
|
|
|
using NzbDrone.Core.Annotations;
|
|
|
|
|
using NzbDrone.Core.ThingiProvider;
|
2015-03-17 04:33:34 +00:00
|
|
|
|
using NzbDrone.Core.Validation;
|
2014-04-19 15:09:22 +00:00
|
|
|
|
using NzbDrone.Core.Validation.Paths;
|
|
|
|
|
|
2016-02-14 16:55:32 +00:00
|
|
|
|
namespace NzbDrone.Core.Download.Clients.Blackhole
|
2014-04-19 15:09:22 +00:00
|
|
|
|
{
|
|
|
|
|
public class UsenetBlackholeSettingsValidator : AbstractValidator<UsenetBlackholeSettings>
|
|
|
|
|
{
|
|
|
|
|
public UsenetBlackholeSettingsValidator()
|
|
|
|
|
{
|
|
|
|
|
RuleFor(c => c.NzbFolder).IsValidPath();
|
2014-05-25 21:58:41 +00:00
|
|
|
|
RuleFor(c => c.WatchFolder).IsValidPath();
|
2014-04-19 15:09:22 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class UsenetBlackholeSettings : IProviderConfig
|
|
|
|
|
{
|
|
|
|
|
private static readonly UsenetBlackholeSettingsValidator Validator = new UsenetBlackholeSettingsValidator();
|
|
|
|
|
|
2017-01-12 02:59:13 +00:00
|
|
|
|
[FieldDefinition(0, Label = "Nzb Folder", Type = FieldType.Path, HelpText = "Folder in which Radarr will store the .nzb file")]
|
2015-10-03 17:45:26 +00:00
|
|
|
|
public string NzbFolder { get; set; }
|
2014-04-19 15:09:22 +00:00
|
|
|
|
|
2017-01-12 02:59:13 +00:00
|
|
|
|
[FieldDefinition(1, Label = "Watch Folder", Type = FieldType.Path, HelpText = "Folder from which Radarr should import completed downloads")]
|
2015-10-03 17:45:26 +00:00
|
|
|
|
public string WatchFolder { get; set; }
|
2014-04-19 15:09:22 +00:00
|
|
|
|
|
2015-03-17 04:33:34 +00:00
|
|
|
|
public NzbDroneValidationResult Validate()
|
2014-04-19 15:09:22 +00:00
|
|
|
|
{
|
2015-03-17 04:33:34 +00:00
|
|
|
|
return new NzbDroneValidationResult(Validator.Validate(this));
|
2014-04-19 15:09:22 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|