#321
|
|||
|
|||
![]()
Temporary workaround? : Change system time to Trigger Script > Set Permission > Restore System Time.
Last edited by mgpai; 16.02.2018 at 17:16. Reason: Typo |
#322
|
||||
|
||||
![]()
After next Update you'll have new commands
disablePermissionChecks(); enablePermissionChecks(); Update will be available in next 5 mins
__________________
JD-Dev & Server-Admin |
#323
|
|||
|
|||
![]()
Thank-you very much !
![]() A new update just became available so using myJDownloader I set my "update check" event's interval to 1000ms, disabled and re-enabled the script, and then the permission box appeared. Hopefully now it will not ask for the permissions again since I did not modify the script since accepting the permissions. Thanks ! I just put the command in the beginning of script ? Last edited by RPH; 16.02.2018 at 17:21. |
#324
|
||||
|
||||
![]()
just add
disablePermissionChecks(); in beginning of your script to disable checks ![]()
__________________
JD-Dev & Server-Admin |
#325
|
|||
|
|||
![]() Quote:
![]() |
#326
|
|||
|
|||
![]() Quote:
Quote:
Edit: @mgpai, I wonder if you'd be so kind as to help me with a related script. This time I want to disable all links in a given package in the Downloads/LinkGrabber list whose file names match file names in the related download folder. So for example if I have a package named "Jan Reports" and it's to be saved to Drive:\PackageName, then the script should match all file names in that package with file names in "Drive:\Jan Reports" and disable all matches. Basically it's the same script as before, except this time the comparison is to actual file names on disk instead of file names in a text file. Is this possible? Last edited by netgearjd; 16.02.2018 at 20:54. |
#327
|
||||
|
||||
![]()
@netgearjd: will be available with next update in 5 mins
__________________
JD-Dev & Server-Admin |
#328
|
|||
|
|||
![]()
@Jiaz: What function name should I use?
|
#329
|
|||
|
|||
![]() Quote:
Code:
github.com/mgpai/resources/blob/master/jdownloader/eventscripter/scripts/netgearjd_2.js Script updated: Code:
github.com/mgpai/resources/blob/master/jdownloader/eventscripter/scripts/netgearjd.js |
#330
|
|||
|
|||
![]()
Hi guys, sorry another quick question. With the code below, is it possible to wait for the runUpdateCheck() to finish before checking if an update is available on the next line of code ? Or maybe there is an all in one API that runs the update check and then updates/restarts if there is one ? Also, where can I find a list of JDownlaoder's APIs ?
Or is it possible to runUpdateCheck() using crontab instead ? EDIT: I guess I could just add a sleep() command after calling runUpdateCheck(). Thanks Code:
runUpdateCheck(); if (isDownloadControllerIdle() && isUpdateAvailable()) { interval = 1000; restartAndUpdate(); } //Functions function runUpdateCheck() { callAPI("update", "runUpdateCheck"); } function isUpdateAvailable() { return callAPI("update", "isUpdateAvailable"); } function restartAndUpdate() { callAPI("update", "restartAndUpdate"); } Last edited by RPH; 17.02.2018 at 16:06. |
#331
|
||||
|
||||
![]()
@netgearjd
getComment and setComment ![]() @RPH: once an update is available, isUpdateAvailable will return true. So I would not think about async check ![]()
__________________
JD-Dev & Server-Admin |
#332
|
|||
|
|||
![]() Quote:
For example: 03:45 AM - Check for updates / download updates - If updates available, install updates 04:00 AM - Start downloads Problem is that runUpdateCheck() doesn't have a return value so the script doesn't wait for the update check to finish before checking if there are updates to install (so they don't get installed). I think I solved this temporarily by adding a sleep(300000) command after runUpdateCheck(). |
#333
|
||||
|
||||
![]()
Adding sleep will help yes. You could also enable auto update and JDownloader will check for pending updates itself. Without restart core updates are not installed. Don't see any reason not to enable auto update
__________________
JD-Dev & Server-Admin |
#334
|
|||
|
|||
![]()
Other than the ones listed in the editor?
Code:
docs.google.com/document/d/1IGeAwg8bQyaCTeTl_WyjLyBPh4NBOayO0_MAmvP5Mu4 |
#335
|
||||
|
||||
![]()
__________________
JD-Dev & Server-Admin |
#336
|
|||
|
|||
![]() Quote:
If there are only non-core updates available, will JDownloader still restart when running the "UpdateAndRestart()" command ? |
#337
|
||||
|
||||
![]()
@RPH: Plugin updates can be installed in background without restart. Also headless is minimum timeout 1hour and not what's defined in advanced settings. Only pending core updates require a restart.
restartAndUpdate -> triggers a restart and enforces update check on startup. Headless version always checks for updates on startup
__________________
JD-Dev & Server-Admin |
#338
|
|||
|
|||
![]() Quote:
Code:
runUpdateCheck(); sleep(300000); if (isDownloadControllerIdle() && isUpdateAvailable()) { interval = 1000; restartAndUpdate(); } |
#339
|
||||
|
||||
![]()
restartAndUpdate will always restart and force an update check, yes
but only when isUpdateAvailable() is true, which is only the case for pending core updates as runUpdateCheck will install plugin updates in background if possible
__________________
JD-Dev & Server-Admin |
#340
|
|||
|
|||
![]() Quote:
![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|