Handle xx as TMDb no language for backdrops (#14941)

This commit is contained in:
Cody Robibero 2025-10-04 13:04:35 -06:00 committed by GitHub
parent bf69f9d8a8
commit ff0a1b999f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View file

@ -185,7 +185,10 @@ namespace MediaBrowser.Providers.Plugins.Tmdb
return requestLanguage;
}
return imageLanguage;
// TMDb now returns xx for no language instead of an empty string.
return string.Equals(imageLanguage, "xx", StringComparison.OrdinalIgnoreCase)
? string.Empty
: imageLanguage;
}
/// <summary>

View file

@ -29,6 +29,7 @@ namespace Jellyfin.Providers.Tests.Tmdb
[InlineData("fr-CA", "fr-BE", "fr-CA")]
[InlineData("fr-CA", "fr", "fr-CA")]
[InlineData("de", "en-US", "de")]
[InlineData("", "en-US", "")]
public static void AdjustImageLanguage_Valid_Success(string imageLanguage, string requestLanguage, string? expected)
{
Assert.Equal(expected, TmdbUtils.AdjustImageLanguage(imageLanguage, requestLanguage));