mirror of
https://github.com/Readarr/Readarr
synced 2025-12-17 22:03:05 +01:00
22 lines
No EOL
864 B
C#
22 lines
No EOL
864 B
C#
using System;
|
|
using FluentValidation;
|
|
using NzbDrone.Core.Configuration;
|
|
using NzbDrone.Core.Validation.Paths;
|
|
|
|
namespace NzbDrone.Api.Config
|
|
{
|
|
public class DownloadClientConfigModule : NzbDroneConfigModule<DownloadClientConfigResource>
|
|
{
|
|
public DownloadClientConfigModule(IConfigService configService, RootFolderValidator rootFolderValidator, PathExistsValidator pathExistsValidator)
|
|
: base(configService)
|
|
{
|
|
SharedValidator.RuleFor(c => c.DownloadedEpisodesFolder)
|
|
.Cascade(CascadeMode.StopOnFirstFailure)
|
|
.IsValidPath()
|
|
.SetValidator(rootFolderValidator)
|
|
.SetValidator(pathExistsValidator)
|
|
.When(c => !String.IsNullOrWhiteSpace(c.DownloadedEpisodesFolder));
|
|
|
|
}
|
|
}
|
|
} |