fix: count pt-BR as pt-PT in subtitle status (#286)
ci / web (push) Successful in 1m7s
e2e / e2e (push) Successful in 3m22s
ci / rust (push) Successful in 3m47s
ci / image (push) Successful in 3m24s

This commit was merged in pull request #286.
This commit is contained in:
2026-11-15 17:43:22 +00:00
parent 77e5177e24
commit e93e7cff0c
5 changed files with 50 additions and 17 deletions
+10
View File
@@ -157,6 +157,16 @@ pub fn rank<'a>(
ranked
}
/// Whether a subtitle in `have` settles a want for `wanted` (§15: pt-PT
/// preferred, pt-BR always fine). An unverified Portuguese embedded track
/// counts too: it satisfies viewing even when no signal resolved the
/// flavour. The daemon's gap loop and the API's `missing` list both read
/// this, so they cannot disagree about what is satisfied.
#[must_use]
pub fn satisfies(wanted: &str, have: &str) -> bool {
have == wanted || (wanted == "pt-PT" && matches!(have, "pt-BR" | "por-unverified"))
}
#[cfg(test)]
mod tests {
use super::*;