Commit Graph

10 Commits

Author SHA1 Message Date
Sucukdeluxe
5b221d5bd5 Add persistent JVM daemon for extraction, fix caching with Set+Array
- JVM extractor now supports --daemon mode: starts once, processes
  multiple archives via stdin JSON protocol, eliminating ~5s JVM boot
  per archive
- TypeScript side: daemon manager starts JVM once, sends requests via
  stdin, falls back to spawning new process if daemon is busy
- Fix extraction progress caching: replaced Object.create(null) + in
  operator with Set<string> + linear Array scan — both Map.has() and
  the in operator mysteriously failed to find keys that were just set
- Daemon auto-shutdown on app quit via shutdownDaemon() in before-quit

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 05:59:13 +01:00
Sucukdeluxe
2ef3983049 Revert to v1.5.49 base + fix "Ausgewählte Downloads starten"
- Restore all source files from v1.5.49 (proven stable on both servers)
- Add startPackages() IPC method that starts only specified packages
- Fix context menu "Ausgewählte Downloads starten" to use startPackages()
  instead of start() which was starting ALL enabled packages

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 17:53:39 +01:00
Sucukdeluxe
8fad61e329 Restore multipart RAR open strategy for JVM extractor
Bring back callback-first RAR multipart opening with explicit RAR5/RAR fallback while keeping 7z.001 on VolumedArchiveInStream to improve 7z-JBinding compatibility on split RAR sets.
2026-03-03 17:32:22 +01:00
Sucukdeluxe
353cef7dbd Add JVM hybrid-extract retry and clean up Java extractor
- Add automatic retry with 3s delay when JVM extractor fails with
  "codecs" or "can't be opened" error during hybrid-extract mode
  (handles transient Windows file locks after download completion)
- Log archive file size before JVM extraction in hybrid mode
- Remove unused ArchiveFormat import, RAR_MULTIPART_RE/RAR_OLDSPLIT_RE
  patterns, and hasOldStyleRarSplits() method from Java extractor
- Keep simple openSevenZipArchive with currentVolumeName tracking

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 16:35:43 +01:00
Sucukdeluxe
93d54c8f84 Fix multi-part RAR: get first stream via callback, track current volume name
Two bugs in SevenZipVolumeCallback caused multi-part RAR extraction to fail:

1. getProperty(NAME) always returned firstFileName instead of tracking the
   last opened volume name. 7z-JBinding needs this to compute subsequent
   volume filenames.

2. The first IInStream was created separately instead of through the
   callback's getStream() method, so the volume name tracker was not
   properly initialized.

Verified with real multi-part RAR5 test archives (3 parts, WinRAR 7.01).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 16:15:44 +01:00
Sucukdeluxe
35e84e652e Fix multi-part RAR: use explicit ArchiveFormat instead of VolumedArchiveInStream
VolumedArchiveInStream only works for .7z.001 splits - it rejects RAR
filenames. For multi-part RAR (.partN.rar), use RandomAccessFileInStream
with explicit ArchiveFormat.RAR5/RAR format specification. Auto-detection
with null format can fail for multi-volume RAR archives.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 16:03:01 +01:00
Sucukdeluxe
d4bf574370 Fix multi-part RAR extraction: use VolumedArchiveInStream for .partN.rar
The JVM extractor used RandomAccessFileInStream for multi-part RAR archives,
which only provides a single file stream. 7z-JBinding requires
VolumedArchiveInStream to access additional volume parts via callback.

Added RAR_MULTIPART_RE and RAR_OLDSPLIT_RE patterns to detect multi-volume
RAR archives and route them through VolumedArchiveInStream, fixing
"Archive file can't be opened with any of the registered codecs" errors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 15:54:09 +01:00
Sucukdeluxe
1fde0a9951 Fix hybrid-extract multi-part archive + extractor CRC handling
- findReadyArchiveSets: for .part1.rar, require ALL package items
  to be terminal before allowing extraction (prevents premature
  extraction when later parts have no targetPath/fileName yet)
- JVM extractor: remove CRCERROR from isPasswordFailure() — only
  DATAERROR indicates wrong password. CRCERROR on archives where
  7z-JBinding falsely reports encrypted no longer triggers password
  cycling.
- looksLikeWrongPassword: remove CRC text matching, keep only
  explicit "data error" for encrypted archives.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 14:52:00 +01:00
Sucukdeluxe
fa30e738d9 Fix UNSUPPORTEDMETHOD: init SevenZipJBinding native libs, pass password to extractSlow
Some checks are pending
Build and Release / build (push) Waiting to run
Root cause: SevenZip.initSevenZipFromPlatformJAR() was never called, so
native compression codecs (RAR5, LZMA2, etc.) were not loaded. Archives
could be opened (header parsing is pure Java) but all extractSlow() calls
returned UNSUPPORTEDMETHOD because no native decoder was available.

- Add ensureSevenZipInitialized() with lazy init before extraction
- Pass password to extractSlow(outStream, password) for RAR5 compatibility
- Add UNSUPPORTEDMETHOD -> legacy fallback in extractor.ts as safety net

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 02:35:19 +01:00
Sucukdeluxe
de369f3bcd Replace extraction backend with SevenZipJBinding + Zip4j JVM sidecar
Some checks are pending
Build and Release / build (push) Waiting to run
- New JVM sidecar (resources/extractor-jvm/) using SevenZipJBinding for
  RAR/7z/TAR and Zip4j for ZIP multipart, matching JDownloader 2 stack
- Auto/JVM/Legacy backend modes via RD_EXTRACT_BACKEND env variable
- Fallback to legacy UnRAR/7z when JVM runtime unavailable
- Fix isJvmRuntimeMissingError false positives on valid extraction errors
- Cache JVM layout resolution to avoid repeated filesystem checks
- Route nested ZIP extraction through JVM backend consistently

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 02:08:42 +01:00