|
|
@ -13,18 +13,20 @@ namespace NzbDrone.Core.Validation.Paths
|
|
|
|
_configService = configService;
|
|
|
|
_configService = configService;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override string GetDefaultMessageTemplate() => "Path is {relationship} configured recycle bin folder";
|
|
|
|
protected override string GetDefaultMessageTemplate() => "Path '{path}' is {relationship} configured recycle bin folder";
|
|
|
|
|
|
|
|
|
|
|
|
protected override bool IsValid(PropertyValidatorContext context)
|
|
|
|
protected override bool IsValid(PropertyValidatorContext context)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var recycleBin = _configService.RecycleBin;
|
|
|
|
var recycleBin = _configService.RecycleBin;
|
|
|
|
var folder = context.PropertyValue.ToString();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (context.PropertyValue == null || recycleBin.IsNullOrWhiteSpace())
|
|
|
|
if (context.PropertyValue == null || recycleBin.IsNullOrWhiteSpace())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var folder = context.PropertyValue.ToString();
|
|
|
|
|
|
|
|
context.MessageFormatter.AppendArgument("path", folder);
|
|
|
|
|
|
|
|
|
|
|
|
if (recycleBin.PathEquals(folder))
|
|
|
|
if (recycleBin.PathEquals(folder))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
context.MessageFormatter.AppendArgument("relationship", "set to");
|
|
|
|
context.MessageFormatter.AppendArgument("relationship", "set to");
|
|
|
|