mirror of
https://github.com/Sonarr/Sonarr.git
synced 2025-01-17 10:45:49 +02:00
Validator will allow empty Path when RootFolderPath has a value
This commit is contained in:
parent
dfe8d5436a
commit
e8d8588199
@ -29,11 +29,13 @@ public SeriesModule(ISeriesService seriesService, ISeriesStatisticsService serie
|
|||||||
|
|
||||||
Get["/{slug}"] = o => GetSeries((string)o.slug.ToString());
|
Get["/{slug}"] = o => GetSeries((string)o.slug.ToString());
|
||||||
|
|
||||||
SharedValidator.RuleFor(s => s.Path).NotEmpty();
|
|
||||||
SharedValidator.RuleFor(s => s.QualityProfileId).ValidId();
|
SharedValidator.RuleFor(s => s.QualityProfileId).ValidId();
|
||||||
|
|
||||||
PostValidator.RuleFor(s => s.Title).NotEmpty();
|
PutValidator.RuleFor(s => s.Path).NotEmpty().When(s => String.IsNullOrEmpty(s.RootFolderPath));
|
||||||
|
PutValidator.RuleFor(s => s.RootFolderPath).NotEmpty().When(s => String.IsNullOrEmpty(s.Path));
|
||||||
|
|
||||||
|
PostValidator.RuleFor(s => s.Title).NotEmpty();
|
||||||
|
PostValidator.RuleFor(s => s.Path).NotEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
private Response GetSeries(string slug)
|
private Response GetSeries(string slug)
|
||||||
|
Loading…
Reference in New Issue
Block a user