fix: count pt-BR as pt-PT in subtitle status
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
77e5177e24
commit
2a71e6fb56
@@ -24,7 +24,7 @@ use std::collections::{BTreeMap, BTreeSet, HashSet};
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::sync::Arc;
|
||||
|
||||
use arr_core::subs::{rank, SubtitleTarget, SubtitleVerdict};
|
||||
use arr_core::subs::{rank, satisfies, SubtitleTarget, SubtitleVerdict};
|
||||
use arr_core::{layout, Language};
|
||||
use arr_db::subtitle_budget::{self as budget, BudgetKind};
|
||||
use arr_db::subtitles::{self as db, PendingSubtitle, SubtitleOrigin, SubtitleState};
|
||||
@@ -112,14 +112,6 @@ pub(crate) async fn load_settings(database: &Db) -> Result<Settings, SubtitleErr
|
||||
})
|
||||
}
|
||||
|
||||
/// 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.
|
||||
fn satisfies(wanted: &str, have: &str) -> bool {
|
||||
have == wanted || (wanted == "pt-PT" && matches!(have, "pt-BR" | "por-unverified"))
|
||||
}
|
||||
|
||||
/// The languages worth fetching when `wanted` is the gap, preferred first.
|
||||
fn acceptable(wanted: &Language) -> Vec<Language> {
|
||||
match wanted {
|
||||
|
||||
Reference in New Issue
Block a user