mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-04-20 21:54:58 -04:00
18 lines
717 B
C#
18 lines
717 B
C#
using System;
|
|
using FluentValidation;
|
|
using NzbDrone.Core.Configuration;
|
|
using NzbDrone.Core.Validation.Paths;
|
|
|
|
namespace NzbDrone.Api.Config
|
|
{
|
|
public class MediaManagementConfigModule : NzbDroneConfigModule<MediaManagementConfigResource>
|
|
{
|
|
public MediaManagementConfigModule(IConfigService configService, PathExistsValidator pathExistsValidator)
|
|
: base(configService)
|
|
{
|
|
SharedValidator.RuleFor(c => c.FileChmod).NotEmpty();
|
|
SharedValidator.RuleFor(c => c.FolderChmod).NotEmpty();
|
|
SharedValidator.RuleFor(c => c.RecycleBin).IsValidPath().SetValidator(pathExistsValidator).When(c => !string.IsNullOrWhiteSpace(c.RecycleBin));
|
|
}
|
|
}
|
|
} |