Fix: do not show download progress if there is not content length

This commit is contained in:
Laurent Clouet
2021-05-29 16:40:21 +02:00
committed by Sheepit Renderfarm
parent 8aab044231
commit 3ffbdbb19b
2 changed files with 4 additions and 2 deletions

View File

@@ -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
Error.Type ret = this.server.HTTPGetFile(url, local_path, this.gui, update_ui);

View File

@@ -436,7 +436,9 @@ public class Server extends Thread {
written += len;
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;
}
}