Backport pull request #15793 from jellyfin/release-10.11.z

Prefer US rating on fallback

Original-merge: 156761405e

Merged-by: crobibero <cody@robibe.ro>

Backported-by: Bond_009 <bond.009@outlook.com>
This commit is contained in:
Shadowghost
2025-12-28 07:22:30 -05:00
committed by Bond_009
parent 928a8458dd
commit 3c802a7505
2 changed files with 26 additions and 3 deletions

View File

@@ -311,15 +311,19 @@ namespace Emby.Server.Implementations.Localization
else
{
// Fall back to server default language for ratings check
// If it has no ratings, use the US ratings
var ratingsDictionary = GetParentalRatingsDictionary() ?? GetParentalRatingsDictionary("us");
var ratingsDictionary = GetParentalRatingsDictionary();
if (ratingsDictionary is not null && ratingsDictionary.TryGetValue(rating, out ParentalRatingScore? value))
{
return value;
}
}
// If we don't find anything, check all ratings systems
// If we don't find anything, check all ratings systems, starting with US
if (_allParentalRatings.TryGetValue("us", out var usRatings) && usRatings.TryGetValue(rating, out var usValue))
{
return usValue;
}
foreach (var dictionary in _allParentalRatings.Values)
{
if (dictionary.TryGetValue(rating, out var value))