saveAs.exists() imrpovements

This commit is contained in:
cyian-1756 2018-07-23 03:12:03 -04:00
parent 1d60bf6956
commit cb1fec52f5

View File

@ -79,7 +79,8 @@ class DownloadFileThread extends Thread {
observer.downloadErrored(url, "Download interrupted"); observer.downloadErrored(url, "Download interrupted");
return; 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)) { if (Utils.getConfigBoolean("file.overwrite", false)) {
logger.info("[!] Deleting existing file" + prettySaveAs); logger.info("[!] Deleting existing file" + prettySaveAs);
saveAs.delete(); saveAs.delete();