Skip to content

Commit

Permalink
Set finishedDownloading Properly
Browse files Browse the repository at this point in the history
  • Loading branch information
CADIndie committed Dec 23, 2024
1 parent 61e1bb5 commit 8edcb09
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/pojlib/util/download/DownloadManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/pojlib/util/download/DownloadUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 8edcb09

Please sign in to comment.