mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-16 11:37:58 +02:00
19 lines
764 B
C#
19 lines
764 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)
|
||
|
.SetValidator(rootFolderValidator)
|
||
|
.SetValidator(pathExistsValidator)
|
||
|
.When(c => !String.IsNullOrWhiteSpace(c.DownloadedEpisodesFolder));
|
||
|
}
|
||
|
}
|
||
|
}
|