fix(core): waive untagged audio on main roots
An und-tagged track on one episode hard-failed the whole Silo S03 pack and blacklisted it. Treat untagged audio as a soft fail with a waiver. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
5a18facc4f
commit
4f283f317c
@@ -259,6 +259,15 @@ When none resolve it, tag the track `por-unverified` and surface it. Do not
|
||||
guess. Guessing toward `kids` gives a child a Brazilian dub; guessing toward
|
||||
`main` rejects a Brazilian film's own audio.
|
||||
|
||||
**Untagged audio.** A track tagged `und`, or carrying no language at all, says
|
||||
nothing. On `main`, when no track matches the original language but one is
|
||||
untagged, it is a soft fail (`audio_language_untagged`): import with a waiver
|
||||
instead of rejecting. Sloppy tags are common in WEB-DL packs, often on a single
|
||||
episode, and a hard fail there blacklists the whole pack (§5.7) over a file
|
||||
that almost always carries the original soundtrack. `kids` is unchanged: its
|
||||
missing-pt-PT case is already a soft fail, and an untagged track never counts
|
||||
as pt-PT.
|
||||
|
||||
**Sourcing consequence for `kids`.** European Portuguese dubs live almost
|
||||
entirely in streaming WEB-DLs (Disney+, Netflix, Max) and essentially never in
|
||||
BluRay encodes or remuxes. That root biases hard toward WEB-DL sources, and
|
||||
|
||||
@@ -947,6 +947,7 @@ fn rule_name(rule: &Rule) -> String {
|
||||
Rule::RequiredAudio => "required_audio".into(),
|
||||
Rule::DubBlacklist(_) => "dub_blacklist".into(),
|
||||
Rule::PortugueseUnverified => "portuguese_unverified".into(),
|
||||
Rule::AudioLanguageUntagged => "audio_language_untagged".into(),
|
||||
Rule::DolbyVisionProfile(_) => "dolby_vision_profile".into(),
|
||||
Rule::Resolution(_) => "resolution".into(),
|
||||
Rule::Source(_) => "source".into(),
|
||||
|
||||
@@ -422,6 +422,9 @@ pub enum Rule {
|
||||
DubBlacklist(Language),
|
||||
/// A Portuguese track whose pt-PT / pt-BR flavour no signal resolved.
|
||||
PortugueseUnverified,
|
||||
/// An audio track tagged `und` (or untagged) where none matched the
|
||||
/// original language: probably the original, but nothing says so.
|
||||
AudioLanguageUntagged,
|
||||
DolbyVisionProfile(DolbyVisionProfile),
|
||||
Resolution(Resolution),
|
||||
Source(Source),
|
||||
@@ -438,6 +441,7 @@ impl Rule {
|
||||
Self::RequiredAudio => "required_audio".into(),
|
||||
Self::DubBlacklist(_) => "dub_blacklist".into(),
|
||||
Self::PortugueseUnverified => "portuguese_unverified".into(),
|
||||
Self::AudioLanguageUntagged => "audio_language_untagged".into(),
|
||||
Self::DolbyVisionProfile(_) => "dolby_vision_profile".into(),
|
||||
Self::Resolution(_) => "resolution".into(),
|
||||
Self::Source(_) => "source".into(),
|
||||
|
||||
@@ -470,6 +470,13 @@ impl PolicyRule for RequiredAudioRule {
|
||||
if context.overrides.allow_english_audio && languages.contains(&english) {
|
||||
return RuleEvaluation::SoftFail(Rule::RequiredAudio);
|
||||
}
|
||||
if matches!(
|
||||
context.policy.required_audio,
|
||||
RequiredAudio::OriginalLanguage
|
||||
) && languages.contains(&Language::Other("und".to_owned()))
|
||||
{
|
||||
return RuleEvaluation::SoftFail(Rule::AudioLanguageUntagged);
|
||||
}
|
||||
Self::failure(context)
|
||||
}
|
||||
}
|
||||
@@ -1242,6 +1249,33 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn main_untagged_audio_is_waived_not_rejected() {
|
||||
let media = probed_audio(vec![track(Language::Other("und".to_owned()))]);
|
||||
assert_eq!(
|
||||
verdict_for(&policy(), &en(), Candidate::PostDownload(&media)),
|
||||
Verdict::Waived(Rule::AudioLanguageUntagged)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn main_untagged_audio_beside_the_original_stays_eligible() {
|
||||
let media = probed_audio(vec![track(en()), track(Language::Other("und".to_owned()))]);
|
||||
assert_eq!(
|
||||
verdict_for(&policy(), &en(), Candidate::PostDownload(&media)),
|
||||
Verdict::Eligible
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn kids_untagged_audio_keeps_the_required_audio_waiver() {
|
||||
let media = probed_audio(vec![track(Language::Other("und".to_owned()))]);
|
||||
assert_eq!(
|
||||
verdict_for(&kids_policy(), &en(), Candidate::PostDownload(&media)),
|
||||
Verdict::Waived(Rule::RequiredAudio)
|
||||
);
|
||||
}
|
||||
|
||||
// §5.2 truth table, `kids` root: require pt-PT, or the original language
|
||||
// when that is already Portuguese; pt-BR never satisfies the requirement.
|
||||
|
||||
|
||||
@@ -463,6 +463,7 @@ const RULE_LABEL: Record<string, string> = {
|
||||
required_audio: "audio",
|
||||
dub_blacklist: "dub",
|
||||
portuguese_unverified: "pt unverified",
|
||||
audio_language_untagged: "audio untagged",
|
||||
dolby_vision_profile: "dv profile",
|
||||
resolution: "resolution",
|
||||
source: "source",
|
||||
|
||||
Reference in New Issue
Block a user