View Single Post
Old 13.10.2019, 22:53
mgpai mgpai is offline
Script Master
Join Date: Sep 2013
Posts: 707

Originally Posted by Demongornot View Post
When I mean undeterminable, I meant that, in order to read said file to check for dupe, it would require to test all possible dates to find the file, from " (script creation date).txt" to " (actual date).txt" and incrementing one (minute at worst, one month at best) at the time, the number of possible combinaisons is too high for that...
While incrementing a number take almost no time or computing power.
You just need to filter results using the download host name.

var folder = JD_HOME + "/history/";
var host = link.getDownloadHost();

var files = getPath(folder).getChildren().filter(function(file) {
    return file.toString().indexOf(host) > -1;

var filesDescending = files.reverse();

This is just FYI. I am not in any way suggesting one method is better than the other.
Reply With Quote