2014-05-13 17:57:46 +00:00
|
|
|
|
using FluentValidation;
|
|
|
|
|
using System;
|
|
|
|
|
using FluentValidation.Results;
|
|
|
|
|
using NzbDrone.Core.Annotations;
|
|
|
|
|
using NzbDrone.Core.ThingiProvider;
|
|
|
|
|
using NzbDrone.Core.Validation.Paths;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Download.Clients.TorrentBlackhole
|
|
|
|
|
{
|
|
|
|
|
public class TorrentBlackholeSettingsValidator : AbstractValidator<TorrentBlackholeSettings>
|
|
|
|
|
{
|
|
|
|
|
public TorrentBlackholeSettingsValidator()
|
|
|
|
|
{
|
|
|
|
|
//Todo: Validate that the path actually exists
|
|
|
|
|
RuleFor(c => c.TorrentFolder).IsValidPath();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class TorrentBlackholeSettings : IProviderConfig
|
|
|
|
|
{
|
|
|
|
|
private static readonly TorrentBlackholeSettingsValidator validator = new TorrentBlackholeSettingsValidator();
|
|
|
|
|
|
2015-03-10 21:00:47 +00:00
|
|
|
|
[FieldDefinition(0, Label = "Torrent Folder", Type = FieldType.Path, HelpText = "Folder in which Sonarr will store the .torrent file")]
|
2014-05-13 17:57:46 +00:00
|
|
|
|
public String TorrentFolder { get; set; }
|
|
|
|
|
|
2015-03-10 21:00:47 +00:00
|
|
|
|
[FieldDefinition(1, Label = "Watch Folder", Type = FieldType.Path, HelpText = "Folder from which Sonarr should import completed downloads")]
|
2014-05-13 17:57:46 +00:00
|
|
|
|
public String WatchFolder { get; set; }
|
|
|
|
|
|
|
|
|
|
public ValidationResult Validate()
|
|
|
|
|
{
|
|
|
|
|
return validator.Validate(this);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|