Commit Graph

497 Commits

Author SHA1 Message Date
Sucukdeluxe
653e756010 Harden download integrity, extraction safety, and update security 2026-03-28 16:27:21 +01:00
Sucukdeluxe
a1d72b6dbc Fix resume tail corruption after terminated streams 2026-03-28 02:30:30 +01:00
Sucukdeluxe
e8c6761bf0 Harden state persistence and fix provider abort handling
- Add safeJsonReplacer to all JSON.stringify calls in storage.ts to prevent
  NaN/Infinity values from corrupting state files and causing queue loss
- Fix LinkSnappy and 1Fichier retry loops: use sleepWithSignal() instead of
  sleep() so abort signals are respected during retry delays
- Fix Debrid-Link polling: replace raw setTimeout with sleepWithSignal() so
  URL generation polling can be cancelled
- Fix Mega-Debrid doConnectApi: clear token cache on 401/403 responses
  instead of caching invalid credentials for 20 minutes
- Add logging when normalizeLoadedSession removes orphaned items so data
  loss during startup is visible in logs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 19:47:58 +01:00
Sucukdeluxe
5aeab9ecad Prevent queue loss during app updates
- Increase quit timeout from 900ms to 5000ms to ensure pending saves complete
- Add persistNowSync() called before update install to flush queue to disk
- Remove blockAllPersistence from shutdown save condition — shutdown must
  always persist to prevent data loss across restarts
- Add temp file recovery as last resort when both primary and backup
  session files are corrupted

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 19:34:48 +01:00
Sucukdeluxe
52bafed0b2 Add archive deobfuscation for hoster-mangled filenames
Some hosters/debrid services obfuscate downloaded archive filenames by
mutating characters and changing extensions (e.g. .part06.rar → .part06.mov,
star_crossed → star_crossfed). This breaks extraction since the extractor
relies on filename patterns to discover archive parts.

New deobfuscateArchiveFiles() method runs after download, before extraction:
- Reads magic bytes of non-archive files via detectArchiveSignature()
- If RAR/7z/ZIP signature found: corrects the extension
- Uses correctly-named sibling .rar files as reference to reconstruct
  the full correct filename including part number
- Updates item.fileName and item.targetPath after rename

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 13:28:40 +01:00
Sucukdeluxe
38179881f5 Fix Debrid-Link key rotation cascade failure, case-sensitive rename, and sample filter
- notDebrid (host-level) no longer burns all keys: stops rotation immediately
  with 5min cooldown instead of cycling through all 9 keys pointlessly
- Remove double provider-blockade: debrid_link_cooldown no longer stacks
  recordProviderFailure + applyProviderBusyBackoff on top of key cooldowns
- Detect timeout cascades: 2+ consecutive transport failures trigger 3min
  cooldown instead of burning remaining keys
- Case-sensitive rename: files with different casing (e.g. lowercase scene
  names) now get properly renamed instead of being skipped as "already matching"
- Extended sample filter: detect -s.mkv suffix and \Sample\ subdirectories
  in auto-rename (already worked in MKV-move)
- Add key status display with state pills in Debrid-Link key stats popup
- Add parseDebridLinkTerminalFailure for fast-fail on exhausted keys

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 13:04:42 +01:00
Sucukdeluxe
c5dd6f4f30 Harden Debrid-Link key failover and pending-state handling
- Add polling loop (5x 2s) in resolveDownloaderEntry when /add returns
  no downloadUrl — Debrid-Link sometimes needs seconds to generate links
- Classify missing/expired downloadUrl as temporary instead of fatal so
  key rotation kicks in before giving up
- Change notDebrid from fatal to temporary — "host may be down" is
  transient, all keys should be tried before failing
- Raise parseRetryAfterMs cap from 2min to 1h — floodDetected mandates
  "retry after 1 hour" per API docs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 19:53:54 +01:00
Sucukdeluxe
2d9fbb07ea Revert daily-log and queue-scope changes back to v1.7.112 state
Remove daily-log module entirely (caused UI freezes due to sync I/O
even after async rewrite). Revert queue-scope stop() change (was for
a different project). All source files now match v1.7.112.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 10:15:28 +01:00
Sucukdeluxe
45310f0bf7 Fix daily-log freezes and revert unrelated queue scope change
- Rewrite daily-log from synchronous fs.writeSync to async buffered
  writes (500ms flush interval), matching the main logger's pattern.
  The sync writes blocked the event loop on every log line.
- Revert the stop() queue scope change from v1.7.114 which was
  intended for a different project.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 10:03:35 +01:00
Sucukdeluxe
c215fdd658 Preserve selected-only run scope across stop/start cycles
When startItems() was used with a subset of items (e.g. 2000 of 6020),
stopping and restarting would pick up ALL 6020 queued items instead of
just the original 2000. Now stop() marks items outside the run set as
"Gestoppt" so they are not automatically included in the next start().

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 09:29:01 +01:00
Sucukdeluxe
d7149829ea Add daily log rotation with monthly folder structure
All log output is now additionally written to daily log files:
  daily-logs/YYYY-MM/YYYY-MM-DD.log (main log)
  daily-logs/YYYY-MM/YYYY-MM-DD-rename.log (rename log)

Automatic cleanup of daily logs older than 30 days. The existing
rd_downloader.log and rename.log continue to work as before.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 09:16:24 +01:00
Sucukdeluxe
180397f10a Revert post-MKV-move auto-rename that corrupted other packages
The post-MKV-move rename pass added in v1.7.107 ran on the shared
mkvLibraryDir (Entpackt/), causing files from OTHER packages to be
renamed to the current package's name. For example, Orange.Is.The.New.Black
files were renamed to Ted.S02E13...SAUERKRAUT.mkv.

Remove the post-MKV-move rename entirely. The original hybrid race
condition (1 file per season not renamed) is far less damaging than
cross-package corruption.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 08:58:07 +01:00
Sucukdeluxe
65650737b1 Refactor Mega-Debrid account UI from textarea to proper account list
Replace the raw login:password textarea with a proper form-based UI:
- Individual Login + Password input fields with "Hinzufügen" button
- List of configured accounts with masked logins and "Entfernen" button
- Duplicate login detection
- Storage format unchanged (megaCredentials stays login:password pairs)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 21:35:17 +01:00
Sucukdeluxe
6df0834b67 Add Mega-Debrid multi-account support with automatic fallback
Multiple Mega-Debrid accounts can now be configured as login:password
pairs (one per line). When an account hits Fair-Use limits or errors,
the next account is tried automatically.

- New parser module mega-debrid-accounts.ts (parse, ID generation,
  masking, serialization)
- Per-account daily limits, usage tracking, enable/disable
- Account rotation with per-mode cooldowns (API failures don't
  block Web attempts)
- Backward compatible: existing single megaLogin/megaPassword
  is auto-migrated to the new format
- UI: textarea for credentials, account list with masked logins

Follows the existing Debrid-Link multi-key pattern.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 20:12:51 +01:00
Sucukdeluxe
d91621bd6d Handle SxxSxx scene typo in episode token extraction
Scene releases occasionally use SxxSxx (e.g. s05s01) instead of
SxxExx — the second S is a typo for E. Add a fallback regex to
detect this pattern and correctly interpret it as S05E01.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 18:03:45 +01:00
Sucukdeluxe
79c178eb0d Skip sample files during auto-rename to prevent (2) MKV duplicates
Sample files like wayne-sample.mkv were renamed by auto-rename which
stripped the -sample suffix. After rename they were indistinguishable
from the main MKV, causing MKV collection to create (2) copies
(e.g. Messiah.Superstar.S01E01...WAYNE (2).mkv at 17 MB alongside
the real 470 MB episode).

Auto-rename now skips files with a "sample" token in their name,
matching the same detection used by MKV collection's sample filter.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 12:06:41 +01:00
Sucukdeluxe
87c097c822 Fix auto-rename race in hybrid extraction missing MKV files
During hybrid extraction, files can finish extracting between the
auto-rename scan and MKV-move, causing them to be moved to the MKV
library dir with their original scene names (e.g. awa-diethundermans03e21hd.mkv).

Add a post-MKV-move auto-rename pass on the MKV library directory to
catch these stragglers and rename them to the proper folder-based name.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 11:53:51 +01:00
Sucukdeluxe
7b764be769 Fix auto-rename episode range folders producing duplicate MKV names
Folder names with episode ranges like S01E01-E08 (common in season
packs from debrid servers) were returned unchanged as target name,
causing all episodes to get the same filename and producing (2)(3)(4)
suffixes during MKV collection.

- Detect episode ranges (S01E01-E08, S01E01-08) in folder names and
  replace them with the source file's specific episode token
- Extend applyEpisodeTokenToFolderName regex to match and replace
  full episode ranges instead of only single episode tokens

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 11:25:10 +01:00
Sucukdeluxe
78fef627bb Fix auto-rename episode pollution and deferred nested extraction abort
- Fix episode-token pollution: packageExtraCandidates included ALL item
  filenames, causing resolveEpisodeTokenForAutoRename to pick up episode
  tokens from unrelated files (e.g. S01E07 from 4sf-...-s01e07 applied
  to all hrs-...-101/102/103 files). This also caused (2)(3) MKV
  suffixes when multiple files were renamed to the same wrong episode.
  Now only the package name (outputDir) is used as extra candidate.
- Fix deferred nested extraction missing abort signal: the nested
  extractPackageArchives call in runDeferredPostExtraction did not
  receive deferredController.signal, making it unabortable on
  stop/cancel/restart.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 16:20:47 +01:00
Sucukdeluxe
30a5832498 Fix auto-rename mixed scene group suffixes 2026-03-11 20:05:12 +01:00
Sucukdeluxe
99455eca94 Fix auto-rename raw episode folder selection 2026-03-11 14:17:51 +01:00
Sucukdeluxe
d9170f4167 Refactor: Extractor in 18 Sektionen reorganisiert 2026-03-10 23:47:02 +01:00
Sucukdeluxe
1a0f49b29c Rebuild download completion verification 2026-03-10 20:22:19 +01:00
Sucukdeluxe
83640b8f1f Honor configured parallel extraction slots 2026-03-10 20:08:43 +01:00
Sucukdeluxe
fbae8a1496 Fix cleanup after partial extraction failures 2026-03-10 19:57:26 +01:00
Sucukdeluxe
113b34fadf Fix parallel extraction false positives 2026-03-10 19:34:42 +01:00
Sucukdeluxe
a054eface5 Improve extraction failure diagnostics 2026-03-10 19:14:21 +01:00
Sucukdeluxe
722fe071cc Harden Debrid-Link completion recovery 2026-03-10 18:27:26 +01:00
Sucukdeluxe
c1a4d8037f Fix Debrid-Link retry recovery 2026-03-10 18:20:19 +01:00
Sucukdeluxe
0a724aed71 Fix BSOD MEMORY_MANAGEMENT on low-RAM servers
- Dynamically compute JVM -Xmx based on system RAM instead of hardcoded 32g
- Reduce peak memory during session loading (inline JSON string, skip redundant clone)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 14:19:49 +01:00
Sucukdeluxe
6c7b1bb088 Keep failed packages out of package cleanup 2026-03-10 12:30:43 +01:00
Sucukdeluxe
17e947fc6b Harden type safety and recovery guards 2026-03-10 05:54:19 +01:00
Sucukdeluxe
17604910b5 Harden startup recovery and stats edge cases 2026-03-10 01:50:16 +01:00
Sucukdeluxe
6d7b3686dc Add AVI video-library support and startup recovery fixes 2026-03-10 00:43:51 +01:00
Sucukdeluxe
b41bb0aeb5 Fix deferred cleanup after MKV move 2026-03-09 23:48:28 +01:00
Sucukdeluxe
ecb5df0a31 Fix startup duplicate archive recovery 2026-03-09 20:38:23 +01:00
Sucukdeluxe
e6b8ea0abe Fix stale extract pending states 2026-03-09 20:14:35 +01:00
Sucukdeluxe
446c41a9b3 Fix extract error status bleed 2026-03-09 19:43:35 +01:00
Sucukdeluxe
51d4e2100f Rename backup menu actions 2026-03-09 18:16:30 +01:00
Sucukdeluxe
a70eacf9cd Harden deferred cleanup races 2026-03-09 17:23:28 +01:00
Sucukdeluxe
4374119f9e Fix session runtime reset 2026-03-09 06:06:39 +01:00
Sucukdeluxe
05df79d518 Refine statistics overview layout 2026-03-09 05:53:05 +01:00
Sucukdeluxe
40f097249c Fix manual extract relabeling 2026-03-09 05:38:56 +01:00
Sucukdeluxe
3de4ba3e90 Fix final post-process requeue stall 2026-03-09 05:33:09 +01:00
Sucukdeluxe
1afce943ae Fix history timing and retention controls 2026-03-09 05:16:41 +01:00
Sucukdeluxe
1f9a26e4b0 Add app runtime statistics 2026-03-09 04:59:00 +01:00
Sucukdeluxe
55e0ebd0f8 Add dedicated rename support logging 2026-03-09 04:48:58 +01:00
Sucukdeluxe
2066d0ad26 Keep manually collapsed packages closed 2026-03-09 04:30:08 +01:00
Sucukdeluxe
a3e3d6faf7 Throttle Mega-Debrid Web validation starts 2026-03-09 04:21:56 +01:00
Sucukdeluxe
85a9a2fa9f Add package and item link export 2026-03-09 04:11:18 +01:00
Sucukdeluxe
7027e11cbd Add support self-check diagnostics 2026-03-09 03:00:36 +01:00
Sucukdeluxe
fc4fafa0d6 Harden support logging and debug setup 2026-03-09 02:47:49 +01:00
Sucukdeluxe
f5f7f14104 Add support bundle and trace tooling 2026-03-09 02:15:32 +01:00
Sucukdeluxe
78fc80f04b Add support audit logging and AI debug manifest 2026-03-09 01:59:08 +01:00
Sucukdeluxe
47742ad7a4 Skip startup cleanup for extract errors 2026-03-09 01:43:43 +01:00
Sucukdeluxe
c898c6de65 Mirror extractor logs to item logs 2026-03-09 01:36:08 +01:00
Sucukdeluxe
56ce7c2aea Add remote host and item diagnostics 2026-03-09 01:21:11 +01:00
Sucukdeluxe
3320f38e47 Adjust unrestrict retry status wording 2026-03-09 00:53:23 +01:00
Sucukdeluxe
87212ddf76 Fix Real-Debrid resume size mismatch handling 2026-03-09 00:32:41 +01:00
Sucukdeluxe
e86c9576e7 Fix Real-Debrid web login session reuse 2026-03-09 00:03:05 +01:00
Sucukdeluxe
5ef9575b95 Improve rename and extractor diagnostics 2026-03-08 22:37:07 +01:00
Sucukdeluxe
bd3c14ad3c Use fixed AllDebrid slot countdowns 2026-03-08 22:15:52 +01:00
Sucukdeluxe
83c0c18dca Hide generic waiting states in queue 2026-03-08 22:02:27 +01:00
Sucukdeluxe
8b941a2777 Limit visible AllDebrid start countdowns 2026-03-08 21:47:11 +01:00
Sucukdeluxe
239154a2c8 Fix AllDebrid paced start scheduling 2026-03-08 21:39:00 +01:00
Sucukdeluxe
63f404285f Tighten idle queue and disk busy status display 2026-03-08 21:18:18 +01:00
Sucukdeluxe
066ef14806 Fix AllDebrid start reservation pacing 2026-03-08 21:08:13 +01:00
Sucukdeluxe
320518dc58 Fix AllDebrid Rapidgator parallel start limit 2026-03-08 21:00:55 +01:00
Sucukdeluxe
df8cbcf1c9 Fix Debrid-Link notDebrid handling 2026-03-08 20:39:00 +01:00
Sucukdeluxe
6a0079f9d0 Harden Debrid-Link cooldown and quota handling 2026-03-08 20:30:33 +01:00
Sucukdeluxe
78b06f2975 Rewrite Debrid-Link v2 unrestrict flow 2026-03-08 20:07:28 +01:00
Sucukdeluxe
8224910091 Harden Debrid-Link HTTP 416 recovery and rename coverage 2026-03-08 19:36:54 +01:00
Sucukdeluxe
c62e3ced0c Fix resume preflight recovery and rename regression coverage 2026-03-08 17:08:09 +01:00
Sucukdeluxe
2123a48bea Fix resume completion and rar fallback handling 2026-03-08 04:49:13 +01:00
Sucukdeluxe
2bd7a187f8 Fix resume retry fallback for truncated direct links 2026-03-08 03:57:37 +01:00
Sucukdeluxe
38c9058beb Fix session stats, extraction UX, and queue UI issues 2026-03-08 03:42:06 +01:00
Sucukdeluxe
ef7905eeb4 Fix legacy extractor path handling 2026-03-08 02:54:37 +01:00
Sucukdeluxe
935f05e214 Fix RAR native extractor fallback 2026-03-08 02:48:49 +01:00
Sucukdeluxe
53c411f635 Release v1.7.45 2026-03-08 02:36:11 +01:00
Sucukdeluxe
28113f57f3 Release v1.7.44 2026-03-08 02:28:51 +01:00
Sucukdeluxe
2a51c443b8 Release v1.7.43 2026-03-08 02:18:53 +01:00
Sucukdeluxe
e4b0f9001e Fix extraction retry loop on CRC/password failures 2026-03-08 02:02:39 +01:00
Sucukdeluxe
9eb28cee2e Add per-package detailed logs 2026-03-08 01:41:23 +01:00
Sucukdeluxe
6b22c93554 Fix auto-recovery re-download for encrypted RAR5 archives
- Always force re-download once when both JVM and legacy extractors fail
  (suggestRedownload=true), regardless of valid archive signature
- Add autoRecoveredForRedownload Set for loop protection (one attempt per archive)
- Clear loop protection on package reset (clearHybridArchiveState)
- Previous sibling-items check failed when other episodes were already
  cleaned up after hybrid extraction
- Lower mini-download retry threshold from 100KB to 5KB

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 01:03:37 +01:00
Sucukdeluxe
9e255d8110 Fix extraction failures on encrypted RAR5 archives with correct file content
- Retry extraction with 2.5s delay on CRC/password errors (Windows file handle race)
- Improve auto-recovery: force re-download when known password fails (content corruption)
- Expand auto-recovery to wrong_password category for encrypted RAR5
- Add fsync after download for pre-allocated files
- Fix permanent extraction failure loop for archives with valid headers but corrupt content

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 00:50:03 +01:00
Sucukdeluxe
27d75153b9 Boost hybrid extraction speed: G1GC, more threads, larger heap
- Switch JVM GC from SerialGC to G1GC with MaxGCPauseMillis=50
  for shorter pause times in long-lived daemon
- Increase JVM heap from 512m/8g to 1g/32g to reduce GC pressure
  on systems with plenty of RAM
- Raise hybrid thread cap from floor(cpuCount/2) capped 8
  to ceil(cpuCount*0.75) capped 12 — downloads are I/O-bound
  and don't need much CPU headroom
- Refresh daemon process priority before each request so hybrid
  extraction gets correct CPU priority even if daemon was started
  with a different priority level

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 00:02:59 +01:00
Sucukdeluxe
d2689aa425 Fix stall-timeout for providers without fileSize (Mega-Debrid Web)
- Early-exit now also uses raw Content-Length as fallback when
  totalBytes is unknown (provider returned fileSize=0)
- Stall handler checks if file is already complete on disk before
  deleting and retrying — prevents re-download loop for files that
  finished but server delayed closing the connection

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 23:46:16 +01:00
Sucukdeluxe
00d873445c Fix stall-timeout false positives on fully downloaded small archive parts
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 23:34:46 +01:00
Sucukdeluxe
307dcf0815 Fix stop→start race conditions causing potential hang
- Add scheduler generation counter to prevent stale scheduler from
  continuing after stop/start cycle
- Guard processItem stop-abort handler: skip status overwrite when a
  new start() has already re-activated the session
- Yield in start() after recoverRetryableItems to let pending abort
  handlers complete before evaluating item states
- Add test: rapid stop → disable provider → start must resolve

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 23:15:05 +01:00
Sucukdeluxe
291c80c7fc Fix auto-recovery re-download loop: check archive magic bytes before forcing re-download
Files with valid RAR/7z/ZIP signature are not corrupt (wrong password),
only files with invalid signature get force-redownloaded.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 22:33:10 +01:00
Sucukdeluxe
556cbd1d85 Fix auto-recovery for CRC-corrupt archives with correct file sizes
- Trust extractor CRC verdict over file size checks
- Re-queue incomplete downloads instead of just warning

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 22:26:49 +01:00
Sucukdeluxe
5c29355e9a Prevent repeated hybrid extraction retries 2026-03-07 22:13:51 +01:00
Sucukdeluxe
9bc9c984cb Fix hybrid auto recovery loops 2026-03-07 21:53:10 +01:00
Sucukdeluxe
fb036733e3 Fix auto-recovery for stale archive parts 2026-03-07 21:27:03 +01:00
Sucukdeluxe
16bfbfc106 Fix archive underflow and extraction readiness 2026-03-07 21:08:43 +01:00
Sucukdeluxe
b8bf9c491c Fallback to UnRAR when 7-Zip fails on encrypted RAR archives
If the primary extractor (7-Zip) fails with wrong_password/checksum
error on a .rar file, automatically try the alternative extractor
(UnRAR/WinRAR) which handles RAR format natively and more reliably.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 20:34:17 +01:00
Sucukdeluxe
167c28f945 Show base provider name in status text instead of key details
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 20:25:32 +01:00
Sucukdeluxe
934f24ae22 Add shift-click range selection for downloads list
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 20:18:27 +01:00
Sucukdeluxe
24e457d84d Revalidate completed items on startup, fix stale session data
Items incorrectly marked as "completed" by the old 50% recovery threshold
persist in the session file across updates. On startup, check all completed
items: if the file on disk is smaller than expected totalBytes, reset to
"queued" so it gets re-downloaded. Also reset items whose files are missing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 20:14:11 +01:00
Sucukdeluxe
e80948df54 Fix disk-fallback in hybrid extract allowing partial files
Two bugs in findReadyArchiveSets disk-fallback:

1. Failed items were explicitly excluded from the blocking check
   (status !== "failed"), so partial downloads with "failed" status
   would not block extraction. Now ANY non-completed item blocks.

2. The disk size check was only > 10 KB, allowing 627 MB partial
   files of 1001 MB archives to pass. Now requires the file to be
   within one allocation unit of the item's expected totalBytes.

Added findItemByDiskPath helper to look up the owning item for a
file on disk and get its expected size.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 20:10:04 +01:00