Detect dead links as permanent errors, fix last-episode extraction race
Build and Release / build (push) Has been cancelled

Dead link detection:
- Mega-Web: parse hoster error messages (hosterNotAvailable, etc.) from HTML
  and throw specific error instead of returning null
- MegaDebridClient: stop retrying on permanent hoster errors
- download-manager: isPermanentLinkError() immediately fails items with dead
  links instead of retrying forever

Extraction race condition:
- package_done cleanup policy checked if all items were "completed" (downloaded)
  but not if they were "extracted" — removing the package before the last
  episode could be extracted
- Both applyCompletedCleanupPolicy and applyPackageDoneCleanup now guard
  against premature removal when autoExtract is enabled

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Sucukdeluxe
2026-03-02 15:28:23 +01:00
co-authored by Claude Opus 4.6
parent 3ed31b7994
commit 09bc354c18
4 changed files with 102 additions and 1 deletions
+4
View File
@@ -505,6 +505,10 @@ class MegaDebridClient {
if (!lastError) {
lastError = web ? "Mega-Web Antwort ohne Download-Link" : "Mega-Web Antwort leer";
}
// Don't retry permanent hoster errors (dead link, file removed, etc.)
if (/permanent ungültig|hosternotavailable|file.?not.?found|file.?unavailable|link.?is.?dead/i.test(lastError)) {
break;
}
if (attempt < REQUEST_RETRIES) {
await sleepWithSignal(retryDelay(attempt), signal);
}