|
|
@ -15,7 +15,7 @@ namespace Sonarr.Api.V3.Series
|
|
|
|
_fileNameBuilder = fileNameBuilder;
|
|
|
|
_fileNameBuilder = fileNameBuilder;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override string GetDefaultMessageTemplate() => "Root folder path contains series folder";
|
|
|
|
protected override string GetDefaultMessageTemplate() => "Root folder path '{rootFolderPath}' contains series folder '{seriesFolder}'";
|
|
|
|
|
|
|
|
|
|
|
|
protected override bool IsValid(PropertyValidatorContext context)
|
|
|
|
protected override bool IsValid(PropertyValidatorContext context)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -24,9 +24,7 @@ namespace Sonarr.Api.V3.Series
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var seriesResource = context.InstanceToValidate as SeriesResource;
|
|
|
|
if (context.InstanceToValidate is not SeriesResource seriesResource)
|
|
|
|
|
|
|
|
|
|
|
|
if (seriesResource == null)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -42,6 +40,9 @@ namespace Sonarr.Api.V3.Series
|
|
|
|
var series = seriesResource.ToModel();
|
|
|
|
var series = seriesResource.ToModel();
|
|
|
|
var seriesFolder = _fileNameBuilder.GetSeriesFolder(series);
|
|
|
|
var seriesFolder = _fileNameBuilder.GetSeriesFolder(series);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context.MessageFormatter.AppendArgument("rootFolderPath", rootFolderPath);
|
|
|
|
|
|
|
|
context.MessageFormatter.AppendArgument("seriesFolder", seriesFolder);
|
|
|
|
|
|
|
|
|
|
|
|
if (seriesFolder == rootFolder)
|
|
|
|
if (seriesFolder == rootFolder)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|