#1
|
|||
|
|||
![]()
I need some help regarding the following situation :
Somehow i´ve got several duplicate links in the download list and I tried to remove those who are added later except for those which are in a deactivated package, but i do not find the correct if-clause to filter the links properly. I got this script from a helpful admin, @mgpai maybe you an help me with this ![]() var urls = []; getAllDownloadLinks().forEach(function(link) { var url = link.contentURL || link.pluginURL; if (urls.indexOf(url) == -1) { urls.push(url); } else { link.remove(); } }) |
#2
|
||||
|
||||
![]()
@PicardHSV: What does not work with this script?
__________________
JD-Dev & Server-Admin |
#3
|
|||
|
|||
![]() Code:
var urls = []; getAllDownloadLinks().forEach(function(link) { var url = link.contentURL || link.pluginURL; if (urls.indexOf(url) == -1) { urls.push(url); } else { link.enabled && link.remove(); } }) |
#4
|
|||
|
|||
![]()
but I forgot about the disabled packages
![]() |
#5
|
|||
|
|||
![]()
The script seems to work, but right now it let the computer hung, you cannot do anything except turning it off
![]() I am not quite sure if the cpu usage will go down, if i put the line sleep(1000); in each branch of the if-clause. Like this : var urls = []; getAllDownloadLinks().forEach(function(link) { var url = link.contentURL || link.pluginURL; alert("Start"); if (urls.indexOf(url) == -1) { urls.push(url); sleep(1000); } else { link.enabled && link.remove(); sleep(1000); } alert("Ende"); }) |
#6
|
|||
|
|||
![]() Quote:
This will delete all dupes in one go rather than 1 by 1: Code:
var urls = []; var dupes = []; getAllDownloadLinks().forEach(function(link) { var url = link.contentURL || link.pluginURL; if (urls.indexOf(url) == -1) { urls.push(url); } else { link.enabled && dupes.push(link.UUID); } }) callAPI("downloadsV2", "removeLinks", dupes, []); |
#7
|
|||
|
|||
![]()
How can I increase the heap size for this script ?
|
#8
|
|||
|
|||
![]()
Which trigger are you using? Any chances multiple instances of the script are running concurrently?
|
#9
|
|||
|
|||
![]()
I do use trigger "Download controller started"
I restarted the computer to be sure that there are no simultaneous scripts running, but i am not quite sure if quitting JD2 it also stops the script..... |
#10
|
||||
|
||||
![]()
Should not be needed.
Probably JD is also on the edge of available memory without said script. 1. Post a screenshot of Help -> About JDownloader. 2. Read this: https://support.jdownloader.org/know...loader-is-slow
__________________
JD Supporter, Plugin Dev. & Community Manager
Erste Schritte & Tutorials || JDownloader 2 Setup Download |
#11
|
|||
|
|||
![]()
but it does not work at all.
I deleted most of the download list, put the trigger to "start Jdownloader" and restarted the programm. After it started I got the message "End", then "Start" and nothing happened. I checked the URLs in some of the packages and they are the same for me, but they are not deleted. |
#12
|
|||
|
|||
![]()
the script starts before the links are completey loaded , i changed the trigger to "download controller started",
started the programm and then the download, seem nothing happens.... Last edited by PicardHSV; 25.02.2025 at 07:50. |
#13
|
||||
|
||||
![]()
@PicardHSV: I think I found a bug, will check it
__________________
JD-Dev & Server-Admin |
#14
|
||||
|
||||
![]()
@PicardHSV: please try again with next core update
__________________
JD-Dev & Server-Admin |
#15
|
|||
|
|||
![]()
I will give a feedback
|
#16
|
||||
|
||||
![]()
CORE-Updates have been released!
All announced bugfixes and features are live! Please update your JDownloader and report any issues you find asap. If this thread gets marked as "[Solved]" by our forum staff you can still post in it and we will read- and reply to it! CORE-Updates wurden released! Alle angekündigten Bugfixes/Features sind nun verfügbar! Bitte JDownloader updaten und eventuelle Bugs schnellstmöglich an uns melden. Falls dieser Thread vom Team als "[Erledigt]" markiert wird, kannst du weiterhin darin antworten und wir lesen/beantworten auch solche Threads! -psp-
__________________
JD Supporter, Plugin Dev. & Community Manager
Erste Schritte & Tutorials || JDownloader 2 Setup Download |
![]() |
Thread Tools | |
Display Modes | |
|
|