#1
|
|||
|
|||
Script Reset doesn't work
Hi all!
Sometimes it happens that some downloads of easybytez are slow so i created a script to reset a download if the speed is slower than 2mb/s (obviously because I usually go to 6mb /s). The problem is that when the script is activated, the download is not reset but only stopped and restarted from the same point. Here's the code: HTML Code:
//check if downloads are running at all
if (isDownloadControllerRunning() && !isDownloadControllerStopping()) {
var running = getRunningDownloadLinks();
//loop through all running Downloads
for (var i = 0; i < running.length; i++) {
//check if the download has been running at least 30 seconds
if (running[i].getDownloadDuration() > 10000) {
//check if the current speed is below 50kb/s
if (running[i].getSpeed() < 2500 * 1024) {
//reset the download
//running[i].reset();
//stop the download and restart it
running[i].abort();
|
#2
|
||||
|
||||
And what is wrong about that? Stop/Resume is okay as it restarts the download. In case speed does not increase, it won't help to do it again. Reset the link will only make you lose all data that got already loaded.
uncomment the .reset line if you really want to reset the download
__________________
JD-Dev & Server-Admin |
#3
|
|||
|
|||
Quote:
So, to reset the part I have to delete .reset? Sorry if i don't understand very well english, is not my native language... |
#4
|
||||
|
||||
Quote:
__________________
JD-Dev & Server-Admin |
#5
|
|||
|
|||
Works great! Thanks so much!!!
|
#6
|
||||
|
||||
You're welcome
__________________
JD-Dev & Server-Admin |
Thread Tools | |
Display Modes | |
|
|