From cb1fec52f551c1091c2c5940fff2ee2117f163cd Mon Sep 17 00:00:00 2001 From: cyian-1756 Date: Mon, 23 Jul 2018 03:12:03 -0400 Subject: [PATCH] saveAs.exists() imrpovements --- .../java/com/rarchives/ripme/ripper/DownloadFileThread.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/rarchives/ripme/ripper/DownloadFileThread.java b/src/main/java/com/rarchives/ripme/ripper/DownloadFileThread.java index f0d78ddb..55b8ffde 100644 --- a/src/main/java/com/rarchives/ripme/ripper/DownloadFileThread.java +++ b/src/main/java/com/rarchives/ripme/ripper/DownloadFileThread.java @@ -79,7 +79,8 @@ class DownloadFileThread extends Thread { observer.downloadErrored(url, "Download interrupted"); return; } - if (saveAs.exists() && !observer.tryResumeDownload() || Utils.fuzzyExists(new File(saveAs.getParent()), saveAs.getName())) { + if (saveAs.exists() && !observer.tryResumeDownload() && !getFileExtFromMIME || + Utils.fuzzyExists(new File(saveAs.getParent()), saveAs.getName()) && getFileExtFromMIME && !observer.tryResumeDownload()) { if (Utils.getConfigBoolean("file.overwrite", false)) { logger.info("[!] Deleting existing file" + prettySaveAs); saveAs.delete();