2015-12-25 09:22:00 +00:00
|
|
|
|
using FluentValidation;
|
2014-02-16 09:56:12 +00:00
|
|
|
|
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();
|
2015-10-03 17:45:26 +00:00
|
|
|
|
SharedValidator.RuleFor(c => c.RecycleBin).IsValidPath().SetValidator(pathExistsValidator).When(c => !string.IsNullOrWhiteSpace(c.RecycleBin));
|
2014-02-16 09:56:12 +00:00
|
|
|
|
}
|
2016-03-25 00:56:29 +00:00
|
|
|
|
|
|
|
|
|
protected override MediaManagementConfigResource ToResource(IConfigService model)
|
|
|
|
|
{
|
|
|
|
|
return MediaManagementConfigResourceMapper.ToResource(model);
|
|
|
|
|
}
|
2014-02-16 09:56:12 +00:00
|
|
|
|
}
|
2019-12-22 21:24:10 +00:00
|
|
|
|
}
|