Fix: do not show download progress if there is not content length
This commit is contained in:
committed by
Sheepit Renderfarm
parent
8aab044231
commit
3ffbdbb19b
@@ -864,7 +864,7 @@ import lombok.Data;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.gui.status(String.format("Downloading %s", download_type), 0, 0);
|
this.gui.status(String.format("Downloading %s", download_type));
|
||||||
|
|
||||||
// must download the archive
|
// must download the archive
|
||||||
Error.Type ret = this.server.HTTPGetFile(url, local_path, this.gui, update_ui);
|
Error.Type ret = this.server.HTTPGetFile(url, local_path, this.gui, update_ui);
|
||||||
|
|||||||
@@ -436,7 +436,9 @@ public class Server extends Thread {
|
|||||||
written += len;
|
written += len;
|
||||||
|
|
||||||
if ((written - lastUpd) > 1000000) { // only update the gui every 1MB
|
if ((written - lastUpd) > 1000000) { // only update the gui every 1MB
|
||||||
gui_.status(status_, (int) (100.0 * written / size), written);
|
if (size != -1) { // no header for contentlength
|
||||||
|
gui_.status(status_, (int) (100.0 * written / size), written);
|
||||||
|
}
|
||||||
lastUpd = written;
|
lastUpd = written;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user