feat(translate): translate a whole playlist so the next episodes are ready #16

Merged
tri merged 1 commits from feat/translate-playlist into main 2026-11-13 23:27:13 +07:00
Owner

Translating a series meant opening each episode and pressing Translate, one at a time. Now Translate Whole Playlist into (Subtitles menu, the header's Subtitles button, and a button in the playlist header) translates every episode in one go, so the next ones are ready before you get to them.

  • Starts with the episode playing, then the ones after it. Episodes run one after another; each one still uses the usual parallel request limit.
  • The progress shows "Episode 3 of 7: Translating…", with the bar counting the whole playlist. Cancel stops it.
  • Episodes that already have a saved translation are skipped without calling the LLM. Episodes without a text subtitle (or that aren't local files) are skipped and listed at the end.
  • Episodes in one folder share the glossary, as before: each episode reloads it, so terms from earlier episodes carry over.
  • The episode playing uses the subtitle you picked. Other episodes aren't open in mpv, so their embedded streams are read with FFmpeg and the source is chosen like for the open one: English first, then the audio language.
  • You can keep watching and switch episodes while it runs. A finished episode's subtitle turns on if it's the one playing; the others load when you open them. A single Translate is still cancelled when you switch videos.
  • An API or disk error stops the whole run, since it would repeat for every episode.

Proof: new subtitleextractortest (source picking on FFmpeg-made files), all 9 tests pass. In the real app (offscreen, Union style, isolated XDG dirs, fake local OpenAI server) on 4 King's Avatar episodes plus a file without subtitles: 4 translated, the file without subtitles reported; switching to the next episode mid-run kept going and turned on its translation; a second run made no LLM requests; Cancel mid-run wrote nothing more.

The new menu entry and playlist button, the progress while episode 2 runs, and the report at the end:

menu playlist button

progress

report

Closes #9

Reviewed with sol-loop: 2 rounds with gpt-6.1-sol. Sol verdict: approved

Created with Claude Opus 5.5 in Claude Code (T3 Code), reviewed by GPT-6.1 Sol.

Translating a series meant opening each episode and pressing Translate, one at a time. Now **Translate Whole Playlist into <language>** (Subtitles menu, the header's Subtitles button, and a button in the playlist header) translates every episode in one go, so the next ones are ready before you get to them. - Starts with the episode playing, then the ones after it. Episodes run one after another; each one still uses the usual parallel request limit. - The progress shows "Episode 3 of 7: Translating…", with the bar counting the whole playlist. Cancel stops it. - Episodes that already have a saved translation are skipped without calling the LLM. Episodes without a text subtitle (or that aren't local files) are skipped and listed at the end. - Episodes in one folder share the glossary, as before: each episode reloads it, so terms from earlier episodes carry over. - The episode playing uses the subtitle you picked. Other episodes aren't open in mpv, so their embedded streams are read with FFmpeg and the source is chosen like for the open one: English first, then the audio language. - You can keep watching and switch episodes while it runs. A finished episode's subtitle turns on if it's the one playing; the others load when you open them. A single Translate is still cancelled when you switch videos. - An API or disk error stops the whole run, since it would repeat for every episode. Proof: new `subtitleextractortest` (source picking on FFmpeg-made files), all 9 tests pass. In the real app (offscreen, Union style, isolated XDG dirs, fake local OpenAI server) on 4 King's Avatar episodes plus a file without subtitles: 4 translated, the file without subtitles reported; switching to the next episode mid-run kept going and turned on its translation; a second run made no LLM requests; Cancel mid-run wrote nothing more. The new menu entry and playlist button, the progress while episode 2 runs, and the report at the end: ![menu](https://git.trivk.dev/attachments/b39b6b16-df34-40f6-89fc-a0118b0c5900) ![playlist button](https://git.trivk.dev/attachments/112391b9-2ae0-4e1d-8db5-fbab5af5d62b) ![progress](https://git.trivk.dev/attachments/d85bf0f8-636f-4929-8f32-8c3e5fea1f32) ![report](https://git.trivk.dev/attachments/27be889c-446d-446c-8b5f-fe8bdc0f2e62) Closes #9 Reviewed with sol-loop: 2 rounds with gpt-6.1-sol. Sol verdict: approved Created with Claude Opus 5.5 in Claude Code (T3 Code), reviewed by GPT-6.1 Sol.
tri added 1 commit 2026-11-13 23:08:14 +07:00
tri merged commit bcfc2f3f6a into main 2026-11-13 23:27:13 +07:00
tri deleted branch feat/translate-playlist 2026-11-13 23:28:01 +07:00
Sign in to join this conversation.