From 24b25287bdd8d78e37f33187f178ef2f2295bbf3 Mon Sep 17 00:00:00 2001 From: sudacode Date: Sat, 28 Nov 2026 03:15:35 -0800 Subject: [PATCH] fix(subsync): harden manual requests, error output, and track reload - validate reference files (absolute regular file, size cap) before reading - redact stream tokens and truncate tool output in failure messages - keep title and lang when re-adding the synced track - ignore an external audio track's ff-index when mapping the video's audio - report discarded stale auto results, bound manual offsets, yield between alignments - update stale subsync docs, fix markdown formatting, discover subtitle tests by lane --- README.md | 18 +-- docs-site/configuration.md | 14 +- docs-site/demos.md | 4 +- docs-site/development.md | 2 +- docs-site/installation.md | 22 +-- docs-site/mining-workflow.md | 9 +- docs-site/shortcuts.md | 34 ++--- package.json | 2 +- scripts/test-lanes.ts | 5 + src/core/services/subsync.test.ts | 120 +++++++++++++++ src/core/services/subsync.ts | 141 ++++++++++++++---- .../services/subtitle-generation-process.ts | 2 +- src/renderer/index.html | 2 +- src/shared/ipc/validators.test.ts | 8 + src/shared/ipc/validators.ts | 7 +- 15 files changed, 306 insertions(+), 84 deletions(-) diff --git a/README.md b/README.md index a760ce8a..5e509834 100644 --- a/README.md +++ b/README.md @@ -116,21 +116,21 @@ A stats dashboard tracks watch time, vocabulary growth, mining throughput, sessi SubMiner runs on Linux, macOS 11+, and Windows 10+. Only **mpv** is required to run it (plus `fuse2` for the Linux AppImage). Mining cards also needs Anki with the [AnkiConnect](https://ankiweb.net/shared/info/2055492159) add-on. Everything else is optional. -| Dependency | Status | What it does | -| ------------------------ | ---------------- | -------------------------------------------------------------------- | -| mpv | Required | The video player SubMiner draws over | -| fuse2 | Required (Linux) | Running the AppImage | -| Anki + AnkiConnect | Required to mine | Card creation from the Yomitan popup | +| Dependency | Status | What it does | +| ------------------------ | ---------------- | ------------------------------------------------------------------------------------------------------------------------ | +| mpv | Required | The video player SubMiner draws over | +| fuse2 | Required (Linux) | Running the AppImage | +| Anki + AnkiConnect | Required to mine | Card creation from the Yomitan popup | | ffmpeg | Recommended | Card audio/screenshots, embedded subtitle extraction, and built-in audio subtitle sync (first-run setup can download it) | | MeCab + mecab-ipadic | Recommended | More accurate N+1, JLPT, and frequency highlighting | | xdotool + xwininfo | Required (X11) | Window tracking on desktops other than Hyprland or Sway | | yt-dlp | Optional | YouTube playback | | xz | Optional | TsukiHime subtitle downloads (most Linux distros already have it) | | alass / ffsubsync | Optional | Extra external subtitle sync engines (built-in alass-based sync and audio VAD are included) | -| whisper.cpp | Optional | [Subtitle generation](https://docs.subminer.moe/subtitle-generation) | -| guessit | Optional | Better title, season, and episode detection for AniSkip and AniList | -| fzf / rofi | Optional | Video picker in the `subminer` launcher (rofi is Linux only) | -| chafa, ffmpegthumbnailer | Optional | Thumbnail previews in the launcher pickers | +| whisper.cpp | Optional | [Subtitle generation](https://docs.subminer.moe/subtitle-generation) | +| guessit | Optional | Better title, season, and episode detection for AniSkip and AniList | +| fzf / rofi | Optional | Video picker in the `subminer` launcher (rofi is Linux only) | +| chafa, ffmpegthumbnailer | Optional | Thumbnail previews in the launcher pickers |
Platform-specific install commands diff --git a/docs-site/configuration.md b/docs-site/configuration.md index 64fe87bc..0bacea0d 100644 --- a/docs-site/configuration.md +++ b/docs-site/configuration.md @@ -525,13 +525,13 @@ Built-in alass-based subtitle alignment works out of the box with no extra sync Optional external [`alass`](https://github.com/kaegi/alass) and [`ffsubsync`](https://github.com/smacke/ffsubsync) binaries are also supported in the guided modal when installed. -| Key | Default | What it does | -| ------------------------ | -------- | ----------------------------------------------------------------------------------------------------------------- | -| `subsync.mode` | `"auto"` | `"auto"` syncs immediately and opens the guided modal only when needed; `"manual"` always opens the modal | -| `subsync.alass_path` | `""` | Optional external `alass` path. Empty auto-discovers from `PATH` | -| `subsync.ffsubsync_path` | `""` | Optional external `ffsubsync` path. Empty auto-discovers from `PATH` | -| `subsync.ffmpeg_path` | `""` | `ffmpeg` path used to extract embedded tracks and audio speech. Empty auto-discovers from `PATH` | -| `subsync.replace` | `true` | Overwrite the subtitle file. When off, write `_retimed.` | +| Key | Default | What it does | +| ------------------------ | -------- | --------------------------------------------------------------------------------------------------------- | +| `subsync.mode` | `"auto"` | `"auto"` syncs immediately and opens the guided modal only when needed; `"manual"` always opens the modal | +| `subsync.alass_path` | `""` | Optional external `alass` path. Empty auto-discovers from `PATH` | +| `subsync.ffsubsync_path` | `""` | Optional external `ffsubsync` path. Empty auto-discovers from `PATH` | +| `subsync.ffmpeg_path` | `""` | `ffmpeg` path used to extract embedded tracks and audio speech. Empty auto-discovers from `PATH` | +| `subsync.replace` | `true` | Overwrite the subtitle file. When off, write `_retimed.` | ### AniList diff --git a/docs-site/demos.md b/docs-site/demos.md index 667e1a90..ca59684b 100644 --- a/docs-site/demos.md +++ b/docs-site/demos.md @@ -2,7 +2,7 @@ Short recordings from real playback sessions. -_Yomitan_ is the pop-up dictionary. _Jimaku_ is a community subtitle database. _alass_ and _ffsubsync_ retime subtitles against the audio. _Jellyfin_ is a self-hosted media server. A _texthooker_ is a web page that mirrors the current subtitle as selectable text. +_Yomitan_ is the pop-up dictionary. _Jimaku_ is a community subtitle database. _alass_ is the subtitle aligner SubMiner's built-in sync is based on. _Jellyfin_ is a self-hosted media server. A _texthooker_ is a web page that mirrors the current subtitle as selectable text.