Skip to content

Commit

Permalink
Fix IsMatch logic (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
scampower3 authored Oct 28, 2024
1 parent d8baf85 commit 62f0dec
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Jellyfin.Plugin.Tvdb/TvdbSdkExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,17 @@ private static bool IsMatch(this string translation, string? language)
return false;
}

language = language?.ToLowerInvariant() switch
var mappedlanguage = language?.ToLowerInvariant() switch
{
"zh-tw" => "zhtw", // Unique case for zh-TW
"pt-br" => "pt", // Unique case for pt-BR0
"pt-pt" => "por", // Unique case for pt-PT
_ => language,
_ => null,
};

if (translation.Equals(language, StringComparison.OrdinalIgnoreCase))
if (mappedlanguage is not null)
{
return true;
return translation.Equals(mappedlanguage, StringComparison.OrdinalIgnoreCase);
}

// try to find a match (ISO 639-2)
Expand Down

0 comments on commit 62f0dec

Please sign in to comment.