Language rule: original language, dubs and pt-BR detection #57
Reference in New Issue
Block a user
Delete Branch "issue/11-language-rule"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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).