Thread: [Developer Feedback required] Behavior of "Stop here" (ger: "Haltemarke)
View Single Post
  #13  
Old 26.11.2022, 11:31
Johsnon Johsnon is offline
Wind Gust
 
Join Date: Jan 2013
Posts: 41
Default

Mit diesem EventScript klappt's ganz gut:
Code:
/*
    STOP ALL Downloads if JDshutdown=ON and no StopMark exists
    Trigger: Interval   (e.g. every 1min)
*/

// get status of StopMark
var isStopMark_active = callAPI ("downloadsV2", "getStopMark"); // "-1.0" = OFF; "0.0" = none


// get status ShutdownExtension
var storage = "cfg/org.jdownloader.extensions.shutdown.ShutdownExtension";
var interfaceName = "org.jdownloader.extensions.shutdown.ShutdownConfig";
var isShutdown_active = callAPI("config", "get", interfaceName, storage, "ShutdownActive");


if ( isShutdown_active && (0.0 >= isStopMark_active) ) {
    alert("STOP");
    callAPI("downloads", "stop");
}
else {
    // no action
}
Ich nutze die Eigenschaft, dass sich das StopMark "selbst entfernt" nachdem es abgeschlossen ist. Wenn dazu noch JDShutdown aktiviert ist, ist das quasi mein Trigger.
Reply With Quote