Wire translation backends into the daemon #216
Closed
opened 2026-08-25 01:50:43 +01:00 by naps62-yolo
·
1 comment
No Branch/Tag Specified
main
ui-mobile-first
codex/fix-action-button-reload
translation
qbit-2
docker
bugs
blitz/subtitles
fix/255-provider-reorder
blitz/feedback-3
subtitles/251-icon-vocab
subtitles/237-relocate-subs
fix/248-title-move-creates-root
blitz/feedback-2
issue/227-abandoned-pack-visible
issue/245-backoff-anchor
issue/240-design-coherence
issue/211-waived-rule
issue/232-plainer-words
issue/246-policy-reclassify
issue/244-root-slash-stored
issue/231-settings-rows
issue/241-reclassify-on-root-change
issue/239-failure-window
issue/230-icon-only
issue/243-root-path-edges
issue/238-attention-liveness
issue/229-back-button
issue/236-root-path-move
issue/226-attention-threshold
issue/228-root-move
blitz/size-bands
size-bands/209-runtime-scale
size-bands/210-size-waiver
size-bands/208-runtime-design
blitz/reliability
reliability/155-sqlx-migrations
reliability/176-refresh-on-add
removal-nav/175-removal-controls
removal-nav/174-season-file-removal
removal-nav/172-search-titles
removal-nav/173-homepage-library
removal-nav/171-untrack-clears
removal-nav/170-chip-align
removal-nav/169-design-amendment
feedback/167-deck-autosearch
feedback/165-chip-colour
feedback/166-header-rail
feedback/163-drop-cast
feedback/164-control-geometry
feedback/162-season-ordering
feedback/161-search-episodes
feedback/160-autotrack-seed
feedback/159-design-amend
blitz/rich-metadata
rich/151-grid
rich/148-search-rows
rich/150-series-meta
rich/149-movie-page
rich/147-search-art
rich/156-rating-null
rich/146-meta-api
rich/145-poster-cols
rich/144-trailer
rich/143-meta-detail
rich/142-design-amend
blitz/153-empty-episode-titles
blitz/152-deck-routes
blitz/141-season-vanished-api
blitz/129-series-detail-view
blitz/140-attention-episode-numbers
blitz/137-season-removals
blitz/133-attention-tv-lanes
blitz/139-movie-id-episode-guard
blitz/134-stale-attention-queue
blitz/124-rss-episode-matching
blitz/136-imdb-series-lookup
blitz/132-manual-commands
blitz/128-series-delete-files
blitz/131-status-seasons-input
blitz/138-plural-season-range
blitz/135-pack-name-parse
blitz/122-upstream-removals
blitz/130-add-series-search
blitz/121-series-refresh
blitz/127-unified-search-tv
blitz/123-episode-matching
blitz/126-tv-attention
blitz/119-tracked-rule
blitz/125-season-deck
blitz/120-tvdb-id
blitz/118-season-zero
blitz/117-design-amend
issue/115-avail-search
issue/112-name-truncate
issue/111-score-colors
No results found.
Labels
Clear labels
area/api
area/ci
area/compat
area/core
area/daemon
area/db
area/dl
area/indexer
area/infra
area/meta
area/parse
area/probe
area/subs
area/web
difficulty/easy
difficulty/hard
difficulty/moderate
difficulty/trivial
phase/1-skeleton
phase/2-logic
phase/3-sourcing
phase/4-movies
phase/5-ui
phase/6-tv
phase/7-people
phase/8-compat
phase/9-subtitles
type/bug
type/chore
type/feature
type/test
arr-api
CI and test harness
arr-compat
arr-core
arr-daemon
arr-db
arr-dl
arr-indexer
workspace and tooling
arr-meta
arr-parse
arr-probe
arr-subs crate: providers, extraction, translation, sync
web/
bounded, obvious approach, few files
subtle correctness or cross-cutting
multiple files, judgement, an interface to design
one file, mechanical, no design decisions
workspace, CI, config, database, empty API and SPA
parsing and policy engine, pure, no network
TMDB and Prowlarr, read-only
movies end to end
search, buckets, library views, queues
seasons, episodes, tracking, derived status
owner tags and notifications
Jellyseerr shim
build order: subtitles, DESIGN.md §15
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: yolo/arr#216
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
arr-daemon/src/main.rsbuildsAppStatewithwith_subtitle_providersbutnever calls
with_translation_backends. The registry #190 defined and#191/#192/#193 fill is therefore always empty in the real binary, so
POST /api/media-files/{id}/subtitles/translateanswers 503 on every requestno matter which
translate-*features the binary was compiled with.Tests do not catch it because they build
AppStatethemselves and inject astub backend, so the endpoint is well covered and still dead in production.
Wire the compiled-in backends from the daemon, selected by the
translation_enginedatabase setting (#198) and configured from thebootstrap keys that already exist (
ARR_TRANSLATE_OPENAI_*,ARR_TRANSLATE_DEEPL_API_KEY,ARR_TRANSLATE_GOOGLE_API_KEY, and theremote-command template).
arr_subs::compiled_engines()already reports whichones this build can offer.
Found while implementing #214.
Depends on: #191, #192, #193, #198
Wired the compiled-in translation backends into
arr-daemon. Two things were needed beyond the daemon-side plumbing:arr-daemon/Cargo.tomlnever turned on any of arr-subs'stranslate-*features on its dependency, soarr_subs::compiled_engines()was empty in the real binary regardless of wiring — added matching pass-through features (translate-openai,translate-deepl,translate-google,translate-command, all off by default, same as arr-subs).crates/arr-daemon/src/main.rsnow has atranslation_backends(&Config)function, built the same waysubtitle_providersalready is: a backend is offered when its feature is compiled in and it has what it needs to construct (OpenAI is offered whenever compiled in, since its API key is optional; DeepL, Google and the remote command backend need their credential/template present).AppState::with_translation_backendsis now called fromapi_state. Which of the offered backends actually runs a given translation stays thetranslation_enginedatabase setting, read per request — unchanged.Branch:
subtitles/216-wire-backends(based onblitz/subtitles), pushed.just cipassed: 653 tests, fmt/clippy/machete/web-check all green.Findings
OpenAi::new/with_base_urltake the model as a constructor argument (per #191, intentionally not a field ofOpenAiConfig), but neither the bootstrap config nor thesubtitle_settingstable (#198) has anywhere to put it — #198's migration only addedtranslation_engine, no model field. Without a value the backend can't be constructed at all, so I addedARR_TRANSLATE_OPENAI_MODEL/translate_openai_modelas a new non-secret bootstrap key (same file/env precedence astranslate_openai_base_url), defaulting togpt-4o-mini. This is a stopgap: worth deciding, in a follow-up issue, whether the model belongs in bootstrap config (fixed per deployment) or should be asubtitle_settingsrow liketranslation_engineis (editable without a restart, per §15's "Configuration" paragraph).remote_command_timeout_seconds(insubtitle_settings, editable from/settings) never reaches theCommandbackend. The backend'sCommandConfig.timeoutis set once at construction (I usedarr_subs::COMMAND_DEFAULT_TIMEOUT); there's no path from the database row to a running backend instance, so editing that setting from the UI currently has no effect until an issue wires it through — contradicts §15's "database rows edited from/settingswithout a restart".