JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1  
Old 03.12.2024, 02:43
Nimboid Nimboid is offline
Super Loader
 
Join Date: Jan 2023
Location: UK
Posts: 25
Default Unresponsive Dialog from Event Scripter

I'm trying to complete an Event Scripter script, which calls the API, to redirect links to a different package depending on characteristics within the link.

So on the initial execution JD displays the confirmation Dialog "Event Scripter permissions required!" because I'm calling linkgrabberv2/addLinks.

My problem is that this is unresponsive to any mouse clicks or keyboard actions like Tab, Space or Return, though it is usually draggable. It is presented with focus on the "allow" button.

I have tried upping the VM to 1G, and deleting some thousands of links, with no improvement in behaviour. The only method of recovery is to Force Quit JD. Any suggestions for a workaround would be appreciated, as I'm sure I'll be needing to edit my script and go through this pain several times. I wondered if a visit to Advance Settings would help, but I haven't discovered anything.

Last edited by Nimboid; 03.12.2024 at 02:44. Reason: Clarification
Reply With Quote
  #2  
Old 03.12.2024, 06:24
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,656
Default

Quote:
Originally Posted by Nimboid View Post
My problem is that this is unresponsive to any mouse clicks or keyboard actions like Tab, Space or Return, though it is usually draggable. It is presented with focus on the "allow" button.
Which trigger? If it has "synchronous execution" checkbox enabled, try disabling it.
Reply With Quote
  #3  
Old 03.12.2024, 09:43
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,750
Default

@Nimboid: Can you please show script and tell us the uses trigger? most likely a deadlock within the EDT due to the enabled "synchronous execution"
__________________
JD-Dev & Server-Admin
Reply With Quote
  #4  
Old 03.12.2024, 13:44
Nimboid Nimboid is offline
Super Loader
 
Join Date: Jan 2023
Location: UK
Posts: 25
Default

Thank you, unchecking 'Synchronous execution' fixed the problem.

Earlier, after taking a break, I had the idea of trying the Test Run option in the Script editor, this also overcame my problem, and is a viable workaround.
Reply With Quote
  #5  
Old 03.12.2024, 14:36
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,750
Default

Quote:
Originally Posted by Jiaz View Post
@Nimboid: Can you please show script and tell us the uses trigger? most likely a deadlock within the EDT due to the enabled "synchronous execution"
Would be nice to have this information so I can try to optimize/avoid the deadlock
__________________
JD-Dev & Server-Admin
Reply With Quote
  #6  
Old 04.12.2024, 00:22
Nimboid Nimboid is offline
Super Loader
 
Join Date: Jan 2023
Location: UK
Posts: 25
Default

Here's a cut down version of the script, exhibits same behaviour:

Code:
// Trigger: A new link has been added
// Hangs with unresponsive Dialog if not Test Run from Script Editor.

log('Trigger: A new link has been added');
log('getName(): ' + link.getName());
var myCrawledLink = crawledLink;

log(myCrawledLink.getUUID()); // 1733248670078
log(typeof myCrawledLink.getUUID()); // string
var myCrawledPackage = myCrawledLink.getPackage();
var packName = myCrawledPackage.getName() + " (caught links)";
var dlPath = myCrawledPackage.getDownloadFolder();

var temp = myCrawledLink.getUUID();
var linkUUIDs = [];
linkUUIDs.push(temp);

try {
    callAPI("linkgrabberv2", "movetoNewPackage", linkUUIDs, [],
        packName,
        dlPath);
    /*
     Parameters
     1 - linkIds (long[])
     2 - pkgIds (long[])
     3 - newPkgName (String)
     4 - downloadPath (String)
    */

    // Next only works if the package already exists!
    /*
    callAPI("linkgrabberv2", "addLinks", {
        "overwritePackagizerRules": true,
        "links": myCrawledLink.linkUrl,
        //"links": myCrawledLink.getContentURL(),
        "packageName": 'Test Package (caughtup)'
    });
    */
    log("API call succeeded");
} catch (err) {
    log("Error: " + err + "");
}

I have further queries about how to achieve my task, which perhaps I should ask in a separate thread.

.
Reply With Quote
  #7  
Old 04.12.2024, 18:08
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,750
Default

@Nimboid: Thanks! Found the cause and working on it
__________________
JD-Dev & Server-Admin
Reply With Quote
  #8  
Old 06.12.2024, 18:23
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,750
Default

@Nimboid: please test again, should no longer cause blocking gui
__________________
JD-Dev & Server-Admin
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 14:39.
Provided By AppWork GmbH | Privacy | Imprint
Parts of the Design are used from Kirsch designed by Andrew & Austin
Powered by vBulletin® Version 3.8.10 Beta 1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.