*General*

- Translation: DownloadsTable_actionPerformed_sortwarner_text: updated info dialog for temporary/final sort RE forum 96353
- SingleDownloadController: added special errorhandling for multihosters which claim that a file is offline refs #90466

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

Former-commit-id: 8f7f14e0be1d010bc1a1a89e38ab1e49b0534c4a
This commit is contained in:
psp 2024-08-28 11:26:13 +00:00
parent ffe0c18ed5
commit 03eb7014b2
3 changed files with 29 additions and 5 deletions

View File

@ -321,10 +321,12 @@ public class SingleDownloadController extends BrowserSettingsThread implements D
private SingleDownloadReturnState download(final LogSource downloadLogger) {
PluginForHost handlePlugin = null;
boolean isMultihoster = false;
try {
downloadLogger.info("DownloadCandidate: " + candidate);
PluginForHost linkPlugin = null;
if (AccountCache.ACCOUNTTYPE.MULTI.equals(candidate.getCachedAccount().getType())) {
isMultihoster = true;
final PluginClassLoaderChild defaultCL = session.getPluginClassLoaderChild(downloadLink.getDefaultPlugin());
PluginClassLoader.setThreadPluginClassLoaderChild(defaultCL, defaultCL);
// this.setContextClassLoader(defaultCL);
@ -463,13 +465,16 @@ public class SingleDownloadController extends BrowserSettingsThread implements D
return ret;
} catch (Throwable throwable) {
final PluginForHost lastPlugin = finalizeProcessingPlugin();
if (isMultihoster) {
throwable = this.getMultihosterError(downloadLink, lastPlugin, throwable);
}
try {
throw throwable;
} catch (InterruptedIOException e) {
} catch (final InterruptedIOException e) {
if (isAborting()) {
throwable = new PluginException(LinkStatus.ERROR_RETRY, null, e);
}
} catch (BrowserException browserException) {
} catch (final BrowserException browserException) {
if (isConnectionOffline(lastPlugin, browserException)) {
throwable = new NoInternetConnection(browserException).fillInStackTrace();
} else if (Exceptions.containsInstanceOf(browserException, InterruptedIOException.class) && isAborting()) {
@ -477,7 +482,7 @@ public class SingleDownloadController extends BrowserSettingsThread implements D
} else if (browserException.getCause() != null) {
throwable = browserException.getCause();
}
} catch (SkipReasonException skipReasonException) {
} catch (final SkipReasonException skipReasonException) {
switch (skipReasonException.getSkipReason()) {
case CAPTCHA:
invalidateLastChallengeResponse(downloadLogger, lastPlugin);
@ -539,6 +544,25 @@ public class SingleDownloadController extends BrowserSettingsThread implements D
}
}
/**
* Execute this on download failure. </br>
* This may return a different Throwable than the one that was initially thrown for example if a multihoster claims that a file is
* offline but we know that it is online.
*/
private Throwable getMultihosterError(final DownloadLink link, final PluginForHost multihosterplugin, final Throwable e) {
if (link == null || multihosterplugin == null || e == null) {
throw new IllegalArgumentException();
}
if (e instanceof PluginException) {
final PluginException eplg = (PluginException) e;
if (eplg.getLinkStatus() == LinkStatus.ERROR_FILE_NOT_FOUND && AvailableStatus.TRUE.equals(link.getAvailableStatus())) {
/* File is online according to original filehoster -> Do not trust offline status from multihoster. */
return new PluginException(LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE, "Multihoster " + multihosterplugin.getHost() + " claims that this file is offline");
}
}
return e;
}
public PluginForHost getProcessingPlugin() {
return processingPlugin.get();
}

View File

@ -696,7 +696,7 @@ public interface GuiTranslation extends TranslateInterface {
@Default(lngs = { "en" }, values = { "Sorted by '%s1'-Column" })
String DownloadsTable_actionPerformed_sortwarner_title(String column);
@Default(lngs = { "en" }, values = { "Your Download list is not in download order any more. \r\nClick twice on the highlighted column header,\r\nto return to default (Top-Down) order." })
@Default(lngs = { "en" }, values = { "Your download list is not in download order any more.\r\nYou just performed a temporary sort.\r\nClick twice on the highlighted column header to return to default (Top-Down) order.\r\nTo perform a permanent sort, press and hold CTRL and click inside any column header." })
String DownloadsTable_actionPerformed_sortwarner_text();
@Default(lngs = { "en" }, values = { "Comment" })

View File

@ -405,7 +405,7 @@ DownloadsPanel_onCloseAction_help=Du hast die Schaltfläche "Schließen" geklick
DownloadsTablePluginLink_getName_object_=Plugin-Menüeinträge
DownloadsTable_DownloadsTable_init_plugins=Plugincache wird neu erstellt...
DownloadsTable_DownloadsTable_object_wait_for_loading_links=Bitte warten. Lade Links...
DownloadsTable_actionPerformed_sortwarner_text=Deine Downloadliste ist nicht mehr nach der Downloadreihenfolge sortiert. \nKlicke solange auf den hervorgehobenen Spaltenkopf \nbis die Sortierung wieder aufgehoben ist.
DownloadsTable_actionPerformed_sortwarner_text=Deine Downloadliste ist nicht mehr nach der Downloadreihenfolge sortiert.\nDies ist nur eine temporäre Sortieransicht.\nKlicke solange auf den hervorgehobenen Spaltenkopf, bis die Sortierung wieder aufgehoben ist.\nUm permanent zu sortieren, drücke und halte STRG und klicke in einen Spaltenkopf deiner Wahl.
DownloadsTable_actionPerformed_sortwarner_title=Sortierung nach Spalte "%s1"
DownloadsTable_layoutDirectFeedback_direct_feedback_line1_negative=Klick hier um ein Downloadproblem zu melden.
DurationColumn_DurationColumn_object_=Dauer