1
0
mirror of https://github.com/RipMeApp/ripme.git synced 2025-09-02 18:33:13 +02:00

downloadexists java.nio

This commit is contained in:
soloturn
2022-01-03 20:10:31 +01:00
parent a3df3d7157
commit 1422e32a43
7 changed files with 15 additions and 15 deletions

View File

@@ -403,14 +403,14 @@ public abstract class AbstractHTMLRipper extends AbstractRipper {
Tells user that a single file in the album they wish to download has
already been downloaded in the past.
*/
public void downloadExists(URL url, File file) {
public void downloadExists(URL url, Path file) {
if (observer == null) {
return;
}
itemsPending.remove(url);
itemsCompleted.put(url, file);
observer.update(this, new RipStatusMessage(STATUS.DOWNLOAD_WARN, url + " already saved as " + file.getAbsolutePath()));
itemsCompleted.put(url, file.toFile());
observer.update(this, new RipStatusMessage(STATUS.DOWNLOAD_WARN, url + " already saved as " + file));
checkIfComplete();
}

View File

@@ -242,14 +242,14 @@ public abstract class AbstractJSONRipper extends AbstractRipper {
* Tells user that a single file in the album they wish to download has
* already been downloaded in the past.
*/
public void downloadExists(URL url, File file) {
public void downloadExists(URL url, Path file) {
if (observer == null) {
return;
}
itemsPending.remove(url);
itemsCompleted.put(url, file);
observer.update(this, new RipStatusMessage(STATUS.DOWNLOAD_WARN, url + " already saved as " + file.getAbsolutePath()));
itemsCompleted.put(url, file.toFile());
observer.update(this, new RipStatusMessage(STATUS.DOWNLOAD_WARN, url + " already saved as " + file));
checkIfComplete();
}

View File

@@ -9,6 +9,7 @@ import java.io.IOException;
import java.lang.reflect.Constructor;
import java.net.MalformedURLException;
import java.net.URL;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -464,7 +465,7 @@ public abstract class AbstractRipper
* @param url
* @param file
*/
public abstract void downloadExists(URL url, File file);
public abstract void downloadExists(URL url, Path file);
/**
* @return Number of files downloaded.

View File

@@ -151,14 +151,14 @@ public abstract class AlbumRipper extends AbstractRipper {
* Tells user that a single file in the album they wish to download has
* already been downloaded in the past.
*/
public void downloadExists(URL url, File file) {
public void downloadExists(URL url, Path file) {
if (observer == null) {
return;
}
itemsPending.remove(url);
itemsCompleted.put(url, file);
observer.update(this, new RipStatusMessage(STATUS.DOWNLOAD_WARN, url + " already saved as " + file.getAbsolutePath()));
itemsCompleted.put(url, file.toFile());
observer.update(this, new RipStatusMessage(STATUS.DOWNLOAD_WARN, url + " already saved as " + file));
checkIfComplete();
}

View File

@@ -89,7 +89,7 @@ class DownloadFileThread extends Thread {
} else {
logger.info("[!] " + Utils.getLocalizedString("skipping") + " " + url + " -- "
+ Utils.getLocalizedString("file.already.exists") + ": " + prettySaveAs);
observer.downloadExists(url, saveAs);
observer.downloadExists(url, saveAs.toPath());
return;
}
}

View File

@@ -60,7 +60,7 @@ class DownloadVideoThread extends Thread {
}
} else {
logger.info("[!] Skipping " + url + " -- file already exists: " + prettySaveAs);
observer.downloadExists(url, saveAs.toFile());
observer.downloadExists(url, saveAs);
return;
}
}

View File

@@ -153,12 +153,11 @@ public abstract class VideoRipper extends AbstractRipper {
/**
* Runs if user tries to redownload an already existing File.
*
* @param url Target URL
* @param url Target URL
* @param file Existing file
*/
@Override
public void downloadExists(URL url, File file) {
public void downloadExists(URL url, Path file) {
if (observer == null) {
return;
}