View Single Post
  #787  
Old 17.06.2019, 18:01
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,549
Default

Quote:
Originally Posted by D.IKE.E View Post
So is it done by changing link.getName to link.getSize or what is the variable?
Code:
// Disable download link, if file exists on disk
// Trigger Required: "A Download Started".

var linkName = link.getName();
var folders = ["c:/downloads/1/", "c:/downloads/2/", "c:/downloads/3/"]; // <- Check if file exists in these folders

folders.forEach(function(folder) {
    if (!link.isEnabled()) return;
    var file = getPath(folder + linkName);
    if (!file.exists()) return;
    if (link.getBytesTotal() == file.getSize()) link.setEnabled(false);
})
Reply With Quote