Quote:
Originally Posted by nicolau
I would like the script to start the connection process for a new download when 5 minutes are left to complete an active download
|
Code:
/*
Start new downloads based of ETA of running downloads
Trigger: Interval
*/
var links = getRunningDownloadLinks();
if (links.length == 3) {
links.some(function(link) {
if (link.getEta() < 60 * 5) {
setMax(4);
setMax(3);
return true;
}
})
}
function setMax(int) {
var interfaceName = "org.jdownloader.settings.GeneralSettings";
var key = "MaxSimultaneDownloads";
callAPI("config", "set", interfaceName, null, key, int);
}