Skip to content

Instantly share code, notes, and snippets.

@HanSooloo
Created September 24, 2016 14:32
Show Gist options
  • Save HanSooloo/dc0abb4907e950e3b25166635df2c781 to your computer and use it in GitHub Desktop.
Save HanSooloo/dc0abb4907e950e3b25166635df2c781 to your computer and use it in GitHub Desktop.
var script = JD_HOME + '/jdownloader-postprocess.sh';
var path = package.getDownloadFolder();
var name = package.getName();
var label = package.getComment() ? package.getComment() : 'N/A';
var links = package.getDownloadLinks() ? package.getDownloadLinks() : [];
var archive[] = package.getArchives();
var FilePath = getPath(path);
function isReallyFinished() {
for (var i = 0; i < links.length; i++) {
if (links[i].getArchive() != null && links[i].getExtractionStatus() != "SUCCESSFUL" || !package.isFinished()) {
return false
}
}
return true
}
log(["archive length: ", archive.length]);
// if (isReallyFinished()) {
// var command = [script, path, name, label, 'PACKAGE_FINISHED']
// log(command)
// log(callSync(command))
// log(['package.getDownloadFolder():', package.getDownloadFolder()])
// log(['FilePath:', FilePath])
// log(FilePath.delete())
// log(package.remove())
// }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment