Keep existing good filename when debrid API returns "download.bin"
or opaque name. Only overwrite item.fileName if the resolved name
is actually better (not opaque, not download.bin).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When post-processing runs, detect items in idle states (queued/paused)
whose target file already exists on disk with non-zero size, and
auto-recover them to "completed" status. This ensures allDone becomes
true, triggering final extraction with archive cleanup (delete mode).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add disk-fallback to findReadyArchiveSets: when all archive parts
physically exist on disk with non-zero size and none are actively
downloading/validating, consider the archive ready for extraction.
This fixes episodes being skipped when a download item's status
was not updated to "completed" despite the file being fully written.
Also improve debug server: raise log limit to 10000 lines,
add grep filter, add /session endpoint for raw session data.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Starts an HTTP server on port 9868 (configurable via debug_port.txt)
when debug_token.txt exists in the app runtime directory. Provides
/health, /log, /status, and /items endpoints for live monitoring.
Token-based auth required.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The validating-stuck timeout (45s) was shorter than the unrestrict
timeout (60s), causing items to be endlessly aborted and retried
before the debrid API call could complete. Now uses unrestrict
timeout + 15s buffer.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Convert all sync FS ops (existsSync, readdirSync, statSync, writeFileSync,
rmSync, renameSync) to async equivalents across download-manager, extractor,
cleanup, storage, and logger to prevent UI freezes
- Replace linear retry delays with exponential backoff + jitter to prevent
retry storms with many parallel downloads
- Deduplicate resolveArchiveItems into single shared function
- Replace Array.shift() O(N) in bandwidth chart with slice-based trimming
- Make logger rotation async in the async flush path
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Don't clear extraction resume state during hybrid mode (skipPostCleanup)
- Mark ALL completed items as "Entpackt" after successful hybrid extraction
to prevent full extraction from re-extracting already-extracted archives
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Previous fix used pathKey-based maps which failed due to path resolution
mismatches on Windows. New approach matches items to archives using
filename regex patterns directly (e.g. prefix.part\d+.rar), which is
robust regardless of path casing/resolution.
Also marks items as "Entpackt" immediately when their archive finishes
instead of waiting for all archives to complete, so completed episodes
show correct status while later episodes are still extracting.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- togglePause: clear retry delays and abort stuck tasks on unpause so
Pause/Start actually recovers stuck downloads
- Fix retry display showing Number.MAX_SAFE_INTEGER instead of "inf"
for unrestrict and generic error retries
- Fix extraction status applied to ALL items in package instead of only
the items belonging to the currently extracting archive
- Make persistNow always async and item-completion stat async to reduce
UI freezes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace Readable.fromWeb() + pipeline with ReadableStream.getReader() loop
- Collect chunks in memory, verify size, then write to disk in one shot
- Add Accept-Encoding: identity to prevent content encoding issues
- Eliminates stream conversion bugs that caused file corruption on some servers
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Patch latest.yml during release to use actual filenames (spaces) instead of electron-builder's dashed names
- Add download size validation before SHA512 check to catch incomplete downloads
- Retry download on integrity mismatch (up to 3 passes) with API refresh
- Re-resolve digest from latest.yml on each retry pass
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>