View Single Post
  #948  
Old 02.10.2019, 09:12
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 731
Default

Quote:
Originally Posted by Amiganer View Post
... if die Download is complete, I hope so...
Let the JD itself delete that link from the his normal Downloadlist (where it was downloaded from)...
Than add the downloaded link (coming from the event above) to a special Packagename, call "Already Downloaded" in the normal Downloadlist (putting the link back in the downloadList). If the links is again in the linkgrabber, it will be marked as double (because it is listed in the downloadList)....
Is this makeable?
It is possible to create a script to move the finished links to a different package, but you may need to disable "GeneralSettings.movefilesifdownloaddestinationchangesenabled" in advanced settings. Else, the files on disk will also be moved, if the source and destination package ("Already Downloaded") download folders are different.

Quote:
Originally Posted by Amiganer View Post
If that works, JD can find double links the way it works now and the downloadList is cleaned up.
Maybe in a next step generate this with counter and generate a list every 100 links, maybe delete links from this list if older than 1year (configurable)...
A better option would be to remove the links from the list by matching the finished date. Following script can be used to remove finished links which are older than 'x' days.

Caution: This script will remove links from the download list

Code:
// Remove finished links older than 'x' days
// Trigger : JDownloader Started

var days = 365; //<- Days to keep the finished links in list

var now = new Date();
var duration = days * 24 * 60 * 60 * 1000;

callAPI("downloadsV2", "queryLinks", {
    "finishedDate": true
}).filter(function(link) {
    return link.finishedDate;
}).forEach(function(link) {
    if (now - link.finishedDate > duration) getDownloadLinkByUUID(link.uuid).remove();
})
Reply With Quote