mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-10 23:33:38 -07:00
New: New releases that fail will be retried a second time after waiting 1hr (configurable) Fixed: Blacklisting releases with the same date and vastly different ages
30 lines
No EOL
1.2 KiB
C#
30 lines
No EOL
1.2 KiB
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)
|
|
.Cascade(CascadeMode.StopOnFirstFailure)
|
|
.IsValidPath()
|
|
.SetValidator(rootFolderValidator)
|
|
.SetValidator(pathExistsValidator)
|
|
.When(c => !String.IsNullOrWhiteSpace(c.DownloadedEpisodesFolder));
|
|
|
|
SharedValidator.RuleFor(c => c.BlacklistGracePeriod)
|
|
.InclusiveBetween(1, 24);
|
|
|
|
SharedValidator.RuleFor(c => c.BlacklistRetryInterval)
|
|
.InclusiveBetween(5, 120);
|
|
|
|
SharedValidator.RuleFor(c => c.BlacklistRetryLimit)
|
|
.InclusiveBetween(0, 10);
|
|
}
|
|
}
|
|
} |