diff --git a/Jellyfin.Plugin.Tvdb/TvdbSdkExtensions.cs b/Jellyfin.Plugin.Tvdb/TvdbSdkExtensions.cs index 0962baf..065d9c1 100644 --- a/Jellyfin.Plugin.Tvdb/TvdbSdkExtensions.cs +++ b/Jellyfin.Plugin.Tvdb/TvdbSdkExtensions.cs @@ -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)