mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
New: Allow CheckForFinishedDownloadInterval to be set from the UI (#3233)
* Adding CheckForFinishedDownloadInterval to config service Changed TaskManager to use a configurable interval for CheckForFinishedDownloadCommand * Adding new CheckForFinishedDownloadInterval to UI Fixes #840
This commit is contained in:

committed by
Leonardo Galli

parent
9985554dcb
commit
f411903e90
@@ -1,4 +1,4 @@
|
|||||||
using NzbDrone.Api.REST;
|
using NzbDrone.Api.REST;
|
||||||
using NzbDrone.Core.Configuration;
|
using NzbDrone.Core.Configuration;
|
||||||
|
|
||||||
namespace NzbDrone.Api.Config
|
namespace NzbDrone.Api.Config
|
||||||
@@ -11,6 +11,7 @@ namespace NzbDrone.Api.Config
|
|||||||
|
|
||||||
public bool EnableCompletedDownloadHandling { get; set; }
|
public bool EnableCompletedDownloadHandling { get; set; }
|
||||||
public bool RemoveCompletedDownloads { get; set; }
|
public bool RemoveCompletedDownloads { get; set; }
|
||||||
|
public int CheckForFinishedDownloadInterval { get; set; }
|
||||||
|
|
||||||
public bool AutoRedownloadFailed { get; set; }
|
public bool AutoRedownloadFailed { get; set; }
|
||||||
public bool RemoveFailedDownloads { get; set; }
|
public bool RemoveFailedDownloads { get; set; }
|
||||||
@@ -28,6 +29,7 @@ namespace NzbDrone.Api.Config
|
|||||||
|
|
||||||
EnableCompletedDownloadHandling = model.EnableCompletedDownloadHandling,
|
EnableCompletedDownloadHandling = model.EnableCompletedDownloadHandling,
|
||||||
RemoveCompletedDownloads = model.RemoveCompletedDownloads,
|
RemoveCompletedDownloads = model.RemoveCompletedDownloads,
|
||||||
|
CheckForFinishedDownloadInterval = model.CheckForFinishedDownloadInterval,
|
||||||
|
|
||||||
AutoRedownloadFailed = model.AutoRedownloadFailed,
|
AutoRedownloadFailed = model.AutoRedownloadFailed,
|
||||||
RemoveFailedDownloads = model.RemoveFailedDownloads
|
RemoveFailedDownloads = model.RemoveFailedDownloads
|
||||||
|
@@ -273,6 +273,13 @@ namespace NzbDrone.Core.Configuration
|
|||||||
set { SetValue("DownloadedMoviesScanInterval", value); }
|
set { SetValue("DownloadedMoviesScanInterval", value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int CheckForFinishedDownloadInterval
|
||||||
|
{
|
||||||
|
get { return GetValueInt("CheckForFinishedDownloadInterval", 1); }
|
||||||
|
|
||||||
|
set { SetValue("CheckForFinishedDownloadInterval", value); }
|
||||||
|
}
|
||||||
|
|
||||||
public int DownloadClientHistoryLimit
|
public int DownloadClientHistoryLimit
|
||||||
{
|
{
|
||||||
get { return GetValueInt("DownloadClientHistoryLimit", 30); }
|
get { return GetValueInt("DownloadClientHistoryLimit", 30); }
|
||||||
|
@@ -16,6 +16,7 @@ namespace NzbDrone.Core.Configuration
|
|||||||
string DownloadClientWorkingFolders { get; set; }
|
string DownloadClientWorkingFolders { get; set; }
|
||||||
int DownloadedMoviesScanInterval { get; set; }
|
int DownloadedMoviesScanInterval { get; set; }
|
||||||
int DownloadClientHistoryLimit { get; set; }
|
int DownloadClientHistoryLimit { get; set; }
|
||||||
|
int CheckForFinishedDownloadInterval { get; set; }
|
||||||
|
|
||||||
//Completed/Failed Download Handling (Download client)
|
//Completed/Failed Download Handling (Download client)
|
||||||
bool EnableCompletedDownloadHandling { get; set; }
|
bool EnableCompletedDownloadHandling { get; set; }
|
||||||
|
@@ -71,7 +71,6 @@ namespace NzbDrone.Core.Jobs
|
|||||||
|
|
||||||
var defaultTasks = new[]
|
var defaultTasks = new[]
|
||||||
{
|
{
|
||||||
new ScheduledTask{ Interval = 1, TypeName = typeof(CheckForFinishedDownloadCommand).FullName},
|
|
||||||
new ScheduledTask{ Interval = 1*60, TypeName = typeof(PreDBSyncCommand).FullName},
|
new ScheduledTask{ Interval = 1*60, TypeName = typeof(PreDBSyncCommand).FullName},
|
||||||
new ScheduledTask{ Interval = 5, TypeName = typeof(MessagingCleanupCommand).FullName},
|
new ScheduledTask{ Interval = 5, TypeName = typeof(MessagingCleanupCommand).FullName},
|
||||||
new ScheduledTask{ Interval = updateInterval, TypeName = typeof(ApplicationUpdateCommand).FullName},
|
new ScheduledTask{ Interval = updateInterval, TypeName = typeof(ApplicationUpdateCommand).FullName},
|
||||||
@@ -98,6 +97,12 @@ namespace NzbDrone.Core.Jobs
|
|||||||
Interval = _configService.DownloadedMoviesScanInterval,
|
Interval = _configService.DownloadedMoviesScanInterval,
|
||||||
TypeName = typeof(DownloadedMoviesScanCommand).FullName
|
TypeName = typeof(DownloadedMoviesScanCommand).FullName
|
||||||
},
|
},
|
||||||
|
|
||||||
|
new ScheduledTask
|
||||||
|
{
|
||||||
|
Interval = Math.Max(_configService.CheckForFinishedDownloadInterval, 1),
|
||||||
|
TypeName = typeof(CheckForFinishedDownloadCommand).FullName
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
var currentTasks = _scheduledTaskRepository.All().ToList();
|
var currentTasks = _scheduledTaskRepository.All().ToList();
|
||||||
@@ -184,7 +189,10 @@ namespace NzbDrone.Core.Jobs
|
|||||||
var netImport = _scheduledTaskRepository.GetDefinition(typeof(NetImportSyncCommand));
|
var netImport = _scheduledTaskRepository.GetDefinition(typeof(NetImportSyncCommand));
|
||||||
netImport.Interval = _configService.NetImportSyncInterval;
|
netImport.Interval = _configService.NetImportSyncInterval;
|
||||||
|
|
||||||
_scheduledTaskRepository.UpdateMany(new List<ScheduledTask> { rss, downloadedMovies, netImport });
|
var checkForFinishedDownloads = _scheduledTaskRepository.GetDefinition(typeof(CheckForFinishedDownloadCommand));
|
||||||
|
checkForFinishedDownloads.Interval = _configService.CheckForFinishedDownloadInterval;
|
||||||
|
|
||||||
|
_scheduledTaskRepository.UpdateMany(new List<ScheduledTask> { rss, downloadedMovies, netImport, checkForFinishedDownloads });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -43,6 +43,18 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group advanced-settings">
|
||||||
|
<label class="col-sm-3 control-label">Check For Finished Downloads Interval</label>
|
||||||
|
|
||||||
|
<div class="col-sm-1 col-sm-push-2 help-inline">
|
||||||
|
<i class="icon-radarr-form-info" title="Interval in minutes to query the download clients for finished downloads"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-sm-2 col-sm-pull-1">
|
||||||
|
<input type="number" name="checkForFinishedDownloadInterval" class="form-control" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user