Commit Graph

27 Commits

Author SHA1 Message Date
Administrator
2d8b3f1bf9 perf: final sweep — hot-path allocation, cached log target, sort-header skip
Last round of targeted wins:

  - upload-manager progress callback was allocating a fresh
    { jobId, speedKbs, bytesUploaded } object on every fs stream chunk
    (hundreds of times per second per active job). Now a single entry
    is created at job start and mutated in place — zero allocations
    on the steady-state progress tick.

  - upload-manager stats timer's two separate activeJobs.values()
    scans (globalSpeedKbs + inProgressBytes) merged into one pass.

  - clouddrop-upload.js reuses a single Buffer.allocUnsafe(chunkSize)
    across all chunks, taking subarray() only for the tail chunk.
    A 1 GB upload no longer allocates 64× 16 MB = 1 GB of short-lived
    buffers — real GC relief during many-file batches.

  - _resolveUploadLogTarget is now cached; the fallback ladder runs
    once per session (or when the user changes the log path / daily-log
    date rolls), not on every 500ms flush.

  - renderRecentUploadsPanel skips updateRecentSortHeaders on the
    append-only fast path — sort state hasn't changed, headers don't
    need recomputing.
2026-04-19 14:02:34 +02:00
Administrator
1164da37ea feat: add Clouddrop.cc as upload hoster (API key auth, chunked uploads)
- New lib/clouddrop-upload.js with chunked upload support (16 MB chunks)
- Auth via Bearer token (cd_XXX format)
- Files < 16 MB: simple multipart POST /api/cloud/upload
- Files > 16 MB: chunked protocol (init → PUT chunks → complete)
- After upload: auto-creates permanent share link via /api/cloud/share-link
- Health check verifies API key by listing root files

Registered in:
- lib/config-store.js (HOSTER_NAMES, templates, DEFAULTS)
- main.js (hosterAccountHasCreds, checkClouddropHealth, runHosterHealthCheck)
- lib/upload-manager.js (_executeUpload dispatch)
- renderer/app.js (HOSTERS, HOSTER_ADD_OPTIONS, getHosterLabel)

Tests: 74/74 pass. ESLint: 0/0.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 06:55:21 +02:00
Administrator
8b68a7a07e fix: prevent retry jobs from getting stuck in waiting state 2026-03-26 10:17:15 +01:00
Administrator
a5b07c0f73 🐛 fix: 'Ausgewählte starten' on queued jobs now force-adds to batch
Previously, clicking 'Ausgewählte starten' on 'Wartet' jobs during an
active upload just showed a toast. But the jobs might NOT actually be
in the batch (skipped during task building).

Now: ALL selected queued/error/aborted jobs are sent to addJobsToBatch.
The upload-manager has duplicate protection (checks jobAbortControllers)
so jobs already in the batch are skipped. Jobs NOT in the batch get
added and start uploading immediately.

Toast now shows exact counts: "X hinzugefügt, Y waren schon im Batch"

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 00:14:53 +01:00
Administrator
ff6f7f8612 🐛 fix: addJobs tracks promises so batch-done waits for them
Previously addJobs() was fire-and-forget — added jobs ran as orphaned
promises. When the original batch completed, batch-done fired and
uploadManager was set to null while added jobs were still running.

Now: added job promises are tracked in _additionalPromises array.
startBatch drains this array after the original tasks complete,
ensuring batch-done only fires when ALL jobs (original + added) finish.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 18:19:59 +01:00
Administrator
e1b03605fa feat: retry/start selected jobs while upload batch is running
Previously, 'Erneut versuchen' and 'Ausgewählte starten' did nothing
when a batch was already running (uploading=true). Failed jobs were
set to 'Wartet' but never actually uploaded because they couldn't be
added to the running batch.

New: upload-manager.addJobs() allows adding tasks to a running batch.
When a batch is active and user retries/starts jobs, they're injected
into the running batch via IPC 'add-jobs-to-batch'. The upload manager
starts processing them immediately using the existing semaphores.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 18:15:31 +01:00
Administrator
d538c7da4f 🐛 fix: account fallback now works for ALL files in batch, not just first
When Account A failed, only the first file got the fallback to Account B.
All subsequent files in the same batch still tried Account A (wasting
all retries), then skipped fallback because _failedAccounts already
had the key.

Now: before the retry loop, each job checks if its account is already
known-failed and immediately switches to the fallback account, avoiding
wasted retries on a known-bad account.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 08:03:44 +01:00
Administrator
cd07f52916 🐛 fix: distinguish 'file not found' from 'file empty' error message
Previously, both missing files (fs.statSync throws) and 0-byte files
produced the same error "Datei ist leer (0 Bytes)". Now:
- Missing files: "Datei nicht gefunden"
- Empty files: "Datei ist leer (0 Bytes)"

Also adds 3 edge case tests (throttle consume(0), unlimited rate,
semaphore release-without-acquire). All 66 tests passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 15:20:37 +01:00
Administrator
a4a2eaa736 🐛 fix: scaleParallelUploads inverted, settings lost on close, IPC leak
- scaleParallelUploads used Math.max instead of Math.min, causing MORE
  concurrent uploads instead of limiting them to the global count
- Settings debounce (350ms) was not flushed on app close — user changes
  made right before closing were lost
- onRemoteClientCount IPC listener was re-registered on every
  renderSettings() call, causing listener accumulation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 14:24:14 +01:00
Administrator
27905d66de 🐛 fix: shutdown countdown ignores mode change, timer leaks
Critical: handleShutdownAfterFinish() captured shutdown mode in a
closure at scheduling time — changing mode during countdown was ignored,
causing unexpected system shutdown/restart/sleep.

Now reads shutdownMode at execution time, clears timer when mode
changes to 'nothing', clears orphaned timers before creating new ones,
and adds error handling on exec() calls.

Also: guard stats timer against double-start in upload-manager.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 13:19:07 +01:00
Administrator
61e458b8ea 🐛 fix: skip 0-byte files, fix drag-drop highlight flicker
- Upload manager now rejects empty files (0 bytes) with clear error
  message instead of sending useless uploads to the server
- Fix drag-drop zone highlight flickering caused by dragleave firing
  on child elements (classic browser bug, fixed with enter/leave counter)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 11:46:04 +01:00
Administrator
d53eea443e feat: multi-account support with primary/fallback and separate API/login types
- Multiple accounts per hoster with drag-sortable priority (primary + fallbacks)
- Separate account types: Web Login and API selectable per hoster
- Account fallback: after all retries fail, automatically switches to next fallback account
- Fix: Byse health check returning [Fehler] OK when API responds with msg "OK"
- Fix: retry during active upload sets status to "Wartet" instead of "Bereit"
- Config migration from single-object to multi-account array format

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 05:00:33 +01:00
Administrator
6b2b2ca04c perf: major rendering optimization for large concurrent uploads
- Throttle progress events to 250ms intervals (was every byte chunk)
- Batch UI updates during uploads (render/statusbar/stats every 200ms)
- In-place row updates instead of full innerHTML table rebuild
- Single-pass queue stats computation (was 9 separate array filters)
- Remove CSS transition on progress bars (caused layout thrashing)
- Event delegation for recent files table (was per-row listener rebind)
- Increase persist debounce to 10s during uploads (was 3s)
- Remove redundant "Ziele auswählen" button (hoster selection on file add)
- Dark title bar via nativeTheme

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 00:18:43 +01:00
Administrator
399e2fbe70 feat: upload progress display, semaphore fix, context menu polish
- Status bar shows uploaded/total bytes (e.g. "16 GB / 281 GB")
  Total is sum of all queue jobs (100GB x 4 hosters = 400GB)
- Fix semaphore acquisition order: hoster-first then global prevents
  jobs waiting on a hoster slot from wasting global semaphore slots,
  significantly increasing active connection utilization
- Context menu: dynamic count on all labels, singular/plural for
  single selection, user-adjusted grouping with separators

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 20:25:13 +01:00
Administrator
25a6b77650 fix: multiple bugs found in deep code analysis
- Guard startBatch against null uploadManager in nextTick (race on fast cancel)
- Fix updateSettings not creating globalThrottle when none existed at start
- Fix updateSettings not updating globalSemaphore limit live
- Fix retry pause: 2500ms → 3000ms as intended
- Remove dead isError code in history (was always false after continue)
- Add signal.aborted check in API upload generator (hosters.js)
- Add extra signal check in throttle consume loop for faster abort
- Fix doodstream debug log path (process.cwd → __dirname)
- Fix updater fetchJson signal listener leak
- Make progress column sortable in queue table

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 04:16:50 +01:00
Administrator
1af7f8a94d fix: serialize interval waits so uploads stagger correctly
Previously all jobs read the same lastStartTime simultaneously,
causing them all to start at once. Now uses a per-hoster promise
chain to ensure each job waits its turn.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 03:56:04 +01:00
Administrator
87833b5808 feat: sortable recent files, start selected context menu, live settings
- Add sortable columns in recent files panel (date, filename, host, link)
- Add "Start selected" to right-click context menu
- Live-apply settings changes during uploads (parallel count, speed limits)
- Add fallback file_code check for upload logging
- Add warning log when upload completes without link

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 03:47:00 +01:00
Administrator
d972e0e913 fix: add 3 second pause between upload retries
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 03:39:28 +01:00
Administrator
3d858b1ffd feat: global speed limit, settings cleanup, abort reset, resize panel
- Global speed throttle (shared across all uploads)
- Settings grouped into sections (Uploads, Verhalten, Log)
- Abort all resets jobs to queued (restartable without reupload)
- fileuploader.log writes immediately per upload
- Staggered interval per hoster (not parallel sleep)
- Recent files panel resizable via drag handle
- History hides aborted entries
- Done jobs removed from queue immediately when setting active

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 03:08:56 +01:00
Administrator
f59539e85b feat: improve account-driven uploads 2026-03-11 02:41:32 +01:00
Administrator
f7e8f9a56c fix: split layout, top-to-bottom queue processing, persist queue on close
- Queue table limited to 50% height with scrollbar, links panel below
- Upload processes files sequentially (file1 all hosters, then file2, etc.)
- Queue state persists immediately after adding files (not debounced)
- Add beforeunload handler to flush pending queue state

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 01:48:39 +01:00
Administrator
d94156943b feat: doodstream login support, auto-remove from queue, byse URL fix
- Add doodstream.com web login (email+password) as alternative to API key
- Fix doodstream login: use X-Requested-With header for JSON response
- Add "Aus der Queue entfernen bei Abschluss" setting
- Fix byse.sx download URLs to use /d/ prefix
- Make config writes async to prevent race conditions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 01:23:27 +01:00
Administrator
06d03e6978 feat: add voe.sx login-based upload support 2026-03-11 00:04:18 +01:00
Administrator
9c56fabce1 fix: critical updater and retry bugs, cleanup listener leaks
- updater: replace undici.request() with fetch() (fixes maxRedirections
  error that blocked auto-update from v1.0.0 to v1.1.0)
- upload-manager: move signalCleanup declaration outside try block
  (was causing ReferenceError in catch, silently breaking ALL retries)
- upload-manager: _combineSignals now returns cleanup fn to prevent
  abort listener accumulation over batch lifetime
- upload-manager: _sleep removes abort listener on normal timer fire
- hosters: apiGet removes abort listener in finally block

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 12:30:06 +01:00
Administrator
3d759eb8a6 fix: semaphore abort support, progress clamp, and additional bug fixes
- Semaphore.acquire() now accepts AbortSignal — waiting jobs are properly
  removed from queue on abort, preventing startBatch from hanging forever
- Clamp upload progress to 0-100% in both upload-manager and renderer
- Upload-manager handles semaphore abort rejection gracefully

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 06:00:38 +01:00
Administrator
25b2afbf11 feat: add queue system, per-hoster settings, retry logic, and full UI overhaul
- Add FIFO semaphore for per-hoster concurrency control
- Add token-bucket speed limiter with abort signal support
- Rewrite upload-manager with retry loop, speed monitoring, and rich progress events
- Add per-hoster settings: retries, max speed, parallel count, restart below speed, time interval, max size
- Add context menu with shutdown-after-finish (sleep/shutdown/restart), always-on-top
- Add z-o-o-m-style queue table with 8 columns, status-colored rows, progress bars
- Add debounced queue rendering with scroll position preservation
- Add statusbar with global speed, total bytes, elapsed time
- Fix speedMonitor interval leak on error and scoping bug
- Fix throttle not respecting abort signal during cancellation
- Fix combined signal listener cleanup
- Bump version to 1.1.0

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 05:57:00 +01:00
Administrator
9729ec6f3e chore: initial commit - Electron multi-hoster uploader 2026-03-10 02:32:06 +01:00