Fix bug in which Minimum retention was not being considered for qBittorrent Client Test

pull/6637/head
Carlos Gustavo Sarmiento 3 months ago committed by GitHub
parent 381ce61aef
commit 7e9f97c7c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -388,7 +388,7 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent
}
}
var minimumRetention = 60 * 24 * 14;
var minimumRetention = GetMinimumRetention();
return new DownloadClientInfo
{
@ -398,6 +398,11 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent
};
}
private int GetMinimumRetention()
{
return 60 * 24 * 14; // 14 days in minutes
}
protected override void Test(List<ValidationFailure> failures)
{
failures.AddIfNotNull(TestConnection());
@ -448,7 +453,8 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent
// Complain if qBittorrent is configured to remove torrents on max ratio
var config = Proxy.GetConfig(Settings);
if ((config.MaxRatioEnabled || config.MaxSeedingTimeEnabled) && (config.MaxRatioAction == QBittorrentMaxRatioAction.Remove || config.MaxRatioAction == QBittorrentMaxRatioAction.DeleteFiles))
var minimumRetention = GetMinimumRetention();
if ((config.MaxRatioEnabled || (config.MaxSeedingTimeEnabled && config.MaxSeedingTime < minimumRetention)) && (config.MaxRatioAction == QBittorrentMaxRatioAction.Remove || config.MaxRatioAction == QBittorrentMaxRatioAction.DeleteFiles))
{
return new NzbDroneValidationFailure(string.Empty, _localizationService.GetLocalizedString("DownloadClientQbittorrentValidationRemovesAtRatioLimit"))
{

Loading…
Cancel
Save