Extract an embedded text track on demand from the panel #260

Closed
opened 2026-08-26 10:14:39 +01:00 by naps62-yolo · 0 comments
Owner

§15 says a text-format embedded track is extracted to a sidecar "because an
extracted track is a legal translation source". Today the only caller of
arr_probe::Extractor is arr-daemon/src/subtitles.rs:913
translation_source(), which runs when the reconcile loop is already
translating a wanted gap. Nothing else can trigger an extraction.

The consequence is on a file where nothing is missing: the wanted set is
satisfied, so the loop never runs, so no sidecar exists, so the manual
translate lane in the subtitle panel (§9.3, #203) reports "nothing to
translate from" about a file that carries an English text track. Manual
translation is reachable only where the automatic path has already been,
which is backwards — §15 treats a manual action as bypassing the wanted set,
not as something that depends on it.

Extracting every text track at import is the wrong answer: a WEB-DL episode
here carries 25 of them, and §15's <video>.<lang>.srt naming would drop 25
sidecars into every title folder and make the row's subtitle chip claim all
25 are on disk.

Extract on demand instead. The panel's translate lane offers the file's
embedded text tracks as sources, and picking one extracts it then.

Three parts:

  1. subtitle_files rows for embedded tracks carry no codec, so nothing
    downstream can tell a subrip track from a PGS one. The fact lives in
    media_files.probed (arr-probe records codec, forced, sdh per
    track since #189). Decide whether the status endpoint joins it in or the
    API reads probed directly.
  2. An endpoint that extracts one track — arr_probe::Extractor is not on
    AppState today; Syncer is, and it is the same shape, so it is the
    precedent to follow. The row it writes is NewSubtitleFile::extracted,
    which already exists.
  3. The panel lists text-format embedded tracks in the source picker,
    extracting on pick. An image-format track is never listed — §15 does not
    OCR.

Not in scope: extraction at import (option 1 above, rejected for the sidecar
count), and re-probing files imported before #189, whose sub_tracks carry
only a language and are therefore invisible to any of this. Those are
re-downloaded rather than migrated.

§15 says a text-format embedded track is extracted to a sidecar "because an extracted track is a legal translation source". Today the only caller of `arr_probe::Extractor` is `arr-daemon/src/subtitles.rs:913` `translation_source()`, which runs when the reconcile loop is already translating a wanted gap. Nothing else can trigger an extraction. The consequence is on a file where nothing is missing: the wanted set is satisfied, so the loop never runs, so no sidecar exists, so the manual translate lane in the subtitle panel (§9.3, #203) reports "nothing to translate from" about a file that carries an English text track. Manual translation is reachable only where the automatic path has already been, which is backwards — §15 treats a manual action as bypassing the wanted set, not as something that depends on it. Extracting every text track at import is the wrong answer: a WEB-DL episode here carries 25 of them, and §15's `<video>.<lang>.srt` naming would drop 25 sidecars into every title folder and make the row's subtitle chip claim all 25 are on disk. **Extract on demand instead.** The panel's translate lane offers the file's embedded text tracks as sources, and picking one extracts it then. Three parts: 1. `subtitle_files` rows for embedded tracks carry no codec, so nothing downstream can tell a `subrip` track from a PGS one. The fact lives in `media_files.probed` (`arr-probe` records `codec`, `forced`, `sdh` per track since #189). Decide whether the status endpoint joins it in or the API reads `probed` directly. 2. An endpoint that extracts one track — `arr_probe::Extractor` is not on `AppState` today; `Syncer` is, and it is the same shape, so it is the precedent to follow. The row it writes is `NewSubtitleFile::extracted`, which already exists. 3. The panel lists text-format embedded tracks in the source picker, extracting on pick. An image-format track is never listed — §15 does not OCR. Not in scope: extraction at import (option 1 above, rejected for the sidecar count), and re-probing files imported before #189, whose `sub_tracks` carry only a language and are therefore invisible to any of this. Those are re-downloaded rather than migrated.
naps62-yolo added the area/apidifficulty/moderatephase/9-subtitlestype/feature labels 2026-08-26 10:14:48 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: yolo/arr#260