View Single Post
  #20  
Old 23.10.2020, 16:51
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,553
Default

Quote:
Originally Posted by dbrown1986 View Post
... would replacing moveTo with copyTo do the trick?
Yes. It is also possible to use eventscripter method to delete the source file if/after it is successfully copied.

Code:
// Move downloaded files to user-specified folder and remove the link from download list
// Trigger: A Download Stopped

if (link.finished) {
    var destinationFolder = getPath("/home/seedit4me/drive/debrid/" + link.package.name);
    var copied = getPath(link.downloadPath).copyTo(destinationFolder);

    if (copied) {
        getPath(link.downloadPath).delete()
        link.remove();
    }
}
Reply With Quote