Language rule: original language, dubs and pt-BR detection #57
Merged
naps62-yolo
merged 1 commits from 2026-08-22 20:33:03 +01:00
issue/11-language-rule into main
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
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: yolo/arr#57
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.
Implements
DESIGN.md§5.2 for #11.Two new policy rules in
arr-core:DubBlacklistRule(the single expression — a blacklisted track rejects only when it is not the title's own language, so a Brazilian film's soundtrack passes inmain) andRequiredAudioRule(original language formain; pt-PT or a Portuguese original forkids, withallow_english_audiowaiving). The title's original language is now an explicitevaluate()input.arr-core/src/lang.rsresolves pt-PT vs pt-BR through the three signals in order: release-name markers, ffprobe stream title/handler_name, container BCP-47 tags. When none resolve — including contradictory signals — the track ispor-unverified: post-download it soft-fails asRule::PortugueseUnverified, so it surfaces as a waiver rather than a guess in either direction.One test per §5.2 truth-table row, both phases, plus the explicit unverified-track acceptance test.
Closes #11
@@ -0,0 +49,4 @@/// Resolve a `por` audio track to a concrete Portuguese variant, or/// [`Language::PortugueseUnverified`] when no signal settles it.#[must_use]pub fn resolve_portuguese(evidence: PortugueseEvidence<'_>) -> Language {resolve_portuguesehas no production caller: the only references are this module’s tests, and no code constructsAudioTrackvalues fromPortugueseEvidence. Consequently post-downloadportracks never receive the stream-title/handler/container evidence needed to becomePortugueseBrazil,PortuguesePortugal, orPortugueseUnverified; the new policy can only work when callers somehow pre-populate those variants. Wire this resolver into the probe-to-core conversion (retaining each stream’s title, handler name, container tag, and release-name markers) before evaluating policy.Deliberate for this issue's scope. #11 is
phase/2-logic,area/core: the pure rule and the three-signal resolver. The caller is the ffprobe wrapper — #19,phase/4-movies— andarr-probeis still an empty stub, so there is no probe-to-core conversion to wire into yet.CLAUDE.mdsays not to implement a dependency's work inline;resolve_portuguese+PortugueseEvidenceis exactly the interface #19 will consume (stream title, handler_name, container tag, name markers all have fields there).