PluginsC:

-updated isDeleteContainer, do not delete on ADD_CONTAINER_ACTION
-updated logging
-refs thread 96300

git-svn-id: svn://svn.jdownloader.org/jdownloader/trunk@49593 ebf7c1c2-ba36-0410-9fe8-c592906822b4

Former-commit-id: fd8a9ba091f43ca01c4d69bd201e75780b5016c9
This commit is contained in:
jiaz 2024-08-15 13:12:57 +00:00
parent 26b89a7857
commit 510b3a3775

View File

@ -237,11 +237,12 @@ public abstract class PluginsC {
final String tmp = Application.getTempResource("").getAbsolutePath();
final String rel = Files.getRelativePath(tmp, file.getAbsolutePath());
if (rel == null) {
final LinkOriginDetails origin = link.getOrigin();
if (origin != null) {
switch (origin.getOrigin()) {
final LinkOriginDetails originDetails = link.getOrigin();
if (originDetails != null) {
switch (originDetails.getOrigin()) {
case DRAG_DROP_ACTION:
case PASTE_LINKS_ACTION:
case ADD_CONTAINER_ACTION:
case EXTENSION:
return false;
default:
@ -250,13 +251,30 @@ public abstract class PluginsC {
}
return true;
} else {
final CrawledLink origin = link.getOriginLink();
logger.fine("Do not ask - just delete: " + origin.getURL());
logger.fine("Do not ask - just delete(isDeleteContainer,1): " + getDebugString(link, file));
askFileDeletion = false;
return true;
}
}
protected String getDebugString(final CrawledLink link, File file) {
final StringBuilder sb = new StringBuilder();
sb.append(file);
sb.append("|");
sb.append(link.getURL());
final CrawledLink originLink = link.getOriginLink();
if (originLink != link) {
sb.append("|");
sb.append(originLink.getURL());
}
final LinkOriginDetails originDetails = link.getOrigin();
if (originDetails != null) {
sb.append("|");
sb.append(originDetails.getOrigin());
}
return sb.toString();
}
private CrawledLink currentLink = null;
public CrawledLink getCurrentLink() {
@ -294,6 +312,7 @@ public abstract class PluginsC {
ArrayList<CrawledLink> retLinks = null;
boolean showException = true;
try {
askFileDeletion = true;
setCurrentLink(source);
/* extract filename from url */
final String sourceURL = new Regex(source.getURL(), "(file:/.+)").getMatch(0);
@ -306,11 +325,12 @@ public abstract class PluginsC {
if (file != null && file.exists() && file.isFile()) {
final CrawledLink origin = source.getOriginLink();
if (origin != null && !StringUtils.containsIgnoreCase(origin.getURL(), "file:/")) {
logger.fine("Do not ask - just delete(decryptContainer,1): " + getDebugString(source, file));
askFileDeletion = false;
} else if (origin != null) {
final String originURL = new Regex(origin.getURL(), "(file:/.+)").getMatch(0);
if (originURL != null && !sourceURL.equalsIgnoreCase(originURL)) {
logger.fine("Do not ask - just delete: " + origin.getURL());
logger.fine("Do not ask - just delete(decryptContainer,2): " + getDebugString(source, file));
askFileDeletion = false;
}
}