Download Handling, Clean Up Drone Folder Leftovers

This commit is contained in:
Qstick 2017-09-17 23:00:37 -04:00
parent 9f689c0233
commit 405e7f981d
24 changed files with 467 additions and 754 deletions

View file

@ -1,4 +1,4 @@
using FluentValidation;
using FluentValidation;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Validation.Paths;
@ -6,19 +6,10 @@ namespace NzbDrone.Api.Config
{
public class DownloadClientConfigModule : NzbDroneConfigModule<DownloadClientConfigResource>
{
public DownloadClientConfigModule(IConfigService configService,
RootFolderValidator rootFolderValidator,
PathExistsValidator pathExistsValidator,
MappedNetworkDriveValidator mappedNetworkDriveValidator)
public DownloadClientConfigModule(IConfigService configService)
: base(configService)
{
SharedValidator.RuleFor(c => c.DownloadedAlbumsFolder)
.Cascade(CascadeMode.StopOnFirstFailure)
.IsValidPath()
.SetValidator(rootFolderValidator)
.SetValidator(mappedNetworkDriveValidator)
.SetValidator(pathExistsValidator)
.When(c => !string.IsNullOrWhiteSpace(c.DownloadedAlbumsFolder));
}
protected override DownloadClientConfigResource ToResource(IConfigService model)
@ -26,4 +17,4 @@ namespace NzbDrone.Api.Config
return DownloadClientConfigResourceMapper.ToResource(model);
}
}
}
}