From bbba54c28c127b7ea6883e51d5cdc34c1e9140ed Mon Sep 17 00:00:00 2001 From: LockhartKZ Date: Sat, 4 Jul 2026 18:56:08 +0300 Subject: [PATCH] Translate from preserved source, retry transient errors, add parallel requests - Cue.source keeps the original text: retranslate (per-line or full re-run) always starts from the source, never from a previous translation. - Transient LLM errors (network/timeout/429/5xx) retry with backoff instead of killing a long run; cancel mid-request now shows the cancel toast. - Progress refresh coalesced to one per animation frame (was quadratic on large files). - New "Parallel requests" option (default 1 = old sequential behaviour): batches translated concurrently, big speedup on cloud endpoints. - Bump version to 0.3.0. Co-Authored-By: Claude Fable 5 --- README.md | 5 +- index.html | 4 + package.json | 2 +- src-tauri/Cargo.lock | 2 +- src-tauri/Cargo.toml | 2 +- src-tauri/tauri.conf.json | 2 +- src/lib/llm/client.ts | 14 ++++ src/lib/settings.ts | 3 + src/lib/subtitle/ass.ts | 2 +- src/lib/subtitle/srt.ts | 2 +- src/lib/subtitle/types.ts | 7 ++ src/lib/translate/engine.ts | 149 +++++++++++++++++++++++++++--------- src/main.ts | 29 +++++-- tests/engine.test.ts | 80 ++++++++++++++++++- 14 files changed, 251 insertions(+), 52 deletions(-) diff --git a/README.md b/README.md index 4deb023..22ec90e 100644 --- a/README.md +++ b/README.md @@ -90,8 +90,9 @@ need FUSE 2 once: `sudo apt install libfuse2t64` (older distros: `libfuse2`). 4. Open **Model & connection**, choose your endpoint preset, click **Test connection** (this also lists the available models), pick a model. 5. Optionally adjust **Translation options** — *Lines per batch* (how many lines go to - the model at once) and *Context lines* (how many already-translated lines to show it - for continuity). + the model at once), *Context lines* (how many already-translated lines to show it + for continuity), and *Parallel requests* (batches translated at once — a big speedup + on cloud endpoints; keep it at 1 for local servers and best context continuity). 6. Optionally fill in **Context / notes for the model** — a short description of the movie/show so the model uses the right terminology. e.g. for a chess film: *"keep chess terms accurate (grandmaster, gambit) and leave move notation like Nf3, O-O diff --git a/index.html b/index.html index 78a1023..1c6193e 100644 --- a/index.html +++ b/index.html @@ -77,6 +77,10 @@

Translation options

How many already-translated lines to show the model for continuity (tone, names, gender). 0 disables context. +