2014-02-22 22:03:23 +00:00
|
|
|
|
using System;
|
|
|
|
|
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();
|
2014-02-22 22:03:23 +00:00
|
|
|
|
SharedValidator.RuleFor(c => c.RecycleBin).IsValidPath().SetValidator(pathExistsValidator).When(c => !String.IsNullOrWhiteSpace(c.RecycleBin));
|
2014-02-16 09:56:12 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|