From 8edcb096abe9c67ce5160ca36fc50808b87229ac Mon Sep 17 00:00:00 2001 From: Darien Johnson <84008186+CADIndie@users.noreply.github.com> Date: Tue, 17 Dec 2024 23:55:54 -0500 Subject: [PATCH] Set finishedDownloading Properly --- src/main/java/pojlib/util/download/DownloadManager.java | 2 +- src/main/java/pojlib/util/download/DownloadUtils.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/pojlib/util/download/DownloadManager.java b/src/main/java/pojlib/util/download/DownloadManager.java index b3231658..274a08e0 100644 --- a/src/main/java/pojlib/util/download/DownloadManager.java +++ b/src/main/java/pojlib/util/download/DownloadManager.java @@ -30,7 +30,7 @@ public void fileDownloadComplete(String fileName) { private void getOverallProgress() { int completed = completedFiles.get(); double overallProgress = ((double) completed / totalFiles) * 100; - if (completed == totalFiles) {API.currentDownload = "Finished! Ready to start.";} + if (completed == totalFiles) {API.currentDownload = "Finished! Ready to start."; API.finishedDownloading = true;} API.downloadStatus = overallProgress; } } diff --git a/src/main/java/pojlib/util/download/DownloadUtils.java b/src/main/java/pojlib/util/download/DownloadUtils.java index 6d6399f2..c30e7d9a 100644 --- a/src/main/java/pojlib/util/download/DownloadUtils.java +++ b/src/main/java/pojlib/util/download/DownloadUtils.java @@ -4,6 +4,7 @@ import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.io.IOUtils; +import pojlib.API; import pojlib.util.Logger; import javax.net.ssl.SSLException; @@ -43,6 +44,7 @@ private static void download(URL url, OutputStream os, String fileName, Download } public static void downloadFile(String url, File out, DownloadManager downloadManager) throws IOException { + API.finishedDownloading = false; Objects.requireNonNull(out.getParentFile()).mkdirs(); File tempOut = File.createTempFile(out.getName(), ".part", out.getParentFile()); try {