From 82e5f99f832aa69498d57e253154b676ed826d00 Mon Sep 17 00:00:00 2001 From: Niels van Velzen Date: Wed, 17 Apr 2024 18:44:30 +0200 Subject: Support age in LocalizationManager.GetRatingLevel (#11367) --- Emby.Server.Implementations/Localization/LocalizationManager.cs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'Emby.Server.Implementations/Localization/LocalizationManager.cs') diff --git a/Emby.Server.Implementations/Localization/LocalizationManager.cs b/Emby.Server.Implementations/Localization/LocalizationManager.cs index 16776b6bd..bae201c70 100644 --- a/Emby.Server.Implementations/Localization/LocalizationManager.cs +++ b/Emby.Server.Implementations/Localization/LocalizationManager.cs @@ -278,6 +278,13 @@ namespace Emby.Server.Implementations.Localization return null; } + // Convert integers directly + // This may override some of the locale specific age ratings (but those always map to the same age) + if (int.TryParse(rating, out var ratingAge)) + { + return ratingAge; + } + // Fairly common for some users to have "Rated R" in their rating field rating = rating.Replace("Rated :", string.Empty, StringComparison.OrdinalIgnoreCase); rating = rating.Replace("Rated ", string.Empty, StringComparison.OrdinalIgnoreCase); -- cgit v1.2.3