refactor: replace iso 639 json asset with const dart map

This commit is contained in:
edde746
2026-04-02 17:07:45 +02:00
parent 533472299a
commit fb275ea242
6 changed files with 426 additions and 113 deletions
+2 -8
View File
@@ -239,14 +239,8 @@ bool _languagesMatch(String? mpvLang, String? plexLang) {
// Direct match
if (mpvNormalized == plexNormalized) return true;
// Use LanguageCodes to get all variations and check for overlap
try {
final mpvVariations = LanguageCodes.getVariations(mpvNormalized);
return mpvVariations.contains(plexNormalized);
} catch (_) {
// LanguageCodes not initialized, fall back to direct comparison
return false;
}
final mpvVariations = LanguageCodes.getVariations(mpvNormalized);
return mpvVariations.contains(plexNormalized);
}
/// Check if two subtitle codec strings match