File tree 1 file changed +8
-4
lines changed
src/NzbDrone.Core/Download/Clients/QBittorrent
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -386,16 +386,20 @@ public override DownloadClientInfo GetStatus()
386
386
}
387
387
}
388
388
389
- var minimumRetention = 60 * 24 * 14 ;
390
-
391
389
return new DownloadClientInfo
392
390
{
393
391
IsLocalhost = Settings . Host == "127.0.0.1" || Settings . Host == "localhost" ,
394
392
OutputRootFolders = new List < OsPath > { _remotePathMappingService . RemapRemoteToLocal ( Settings . Host , destDir ) } ,
395
- RemovesCompletedDownloads = ( config . MaxRatioEnabled || ( config . MaxSeedingTimeEnabled && config . MaxSeedingTime < minimumRetention ) ) && ( config . MaxRatioAction == QBittorrentMaxRatioAction . Remove || config . MaxRatioAction == QBittorrentMaxRatioAction . DeleteFiles )
393
+ RemovesCompletedDownloads = RemovesCompletedDownloads ( config )
396
394
} ;
397
395
}
398
396
397
+ private bool RemovesCompletedDownloads ( QBittorrentPreferences config )
398
+ {
399
+ var minimumRetention = 60 * 24 * 14 ; // 14 days in minutes
400
+ return ( config . MaxRatioEnabled || ( config . MaxSeedingTimeEnabled && config . MaxSeedingTime < minimumRetention ) ) && ( config . MaxRatioAction == QBittorrentMaxRatioAction . Remove || config . MaxRatioAction == QBittorrentMaxRatioAction . DeleteFiles ) ;
401
+ }
402
+
399
403
protected override void Test ( List < ValidationFailure > failures )
400
404
{
401
405
failures . AddIfNotNull ( TestConnection ( ) ) ;
@@ -445,7 +449,7 @@ private ValidationFailure TestConnection()
445
449
446
450
// Complain if qBittorrent is configured to remove torrents on max ratio
447
451
var config = Proxy . GetConfig ( Settings ) ;
448
- if ( ( config . MaxRatioEnabled || config . MaxSeedingTimeEnabled ) && ( config . MaxRatioAction == QBittorrentMaxRatioAction . Remove || config . MaxRatioAction == QBittorrentMaxRatioAction . DeleteFiles ) )
452
+ if ( RemovesCompletedDownloads ( config ) )
449
453
{
450
454
return new NzbDroneValidationFailure ( string . Empty , "qBittorrent is configured to remove torrents when they reach their Share Ratio Limit" )
451
455
{
You can’t perform that action at this time.
0 commit comments