aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations
diff options
context:
space:
mode:
authorcrobibero <cody@robibe.ro>2024-05-13 12:47:32 -0400
committerJoshua M. Boniface <joshua@boniface.me>2024-05-13 12:47:32 -0400
commita118498f79abaac49fb6be508786f948f05ad502 (patch)
tree5e35531e037a8c7a1bd28efbf23119e1fcda2e2b /Emby.Server.Implementations
parente5ecdcf8c99f16928b18cb4c0fcc77e1c08b2637 (diff)
Backport pull request #11541 from jellyfin/release-10.9.z
Fix migration with special Rating Original-merge: efba619acbe4849205874a464511ffcfd4aad2ba Merged-by: crobibero <cody@robibe.ro> Backported-by: Joshua M. Boniface <joshua@boniface.me>
Diffstat (limited to 'Emby.Server.Implementations')
-rw-r--r--Emby.Server.Implementations/Localization/LocalizationManager.cs14
1 files changed, 11 insertions, 3 deletions
diff --git a/Emby.Server.Implementations/Localization/LocalizationManager.cs b/Emby.Server.Implementations/Localization/LocalizationManager.cs
index bae201c70..ac453a5b0 100644
--- a/Emby.Server.Implementations/Localization/LocalizationManager.cs
+++ b/Emby.Server.Implementations/Localization/LocalizationManager.cs
@@ -321,7 +321,11 @@ namespace Emby.Server.Implementations.Localization
// Try splitting by : to handle "Germany: FSK-18"
if (rating.Contains(':', StringComparison.OrdinalIgnoreCase))
{
- return GetRatingLevel(rating.AsSpan().RightPart(':').ToString());
+ var ratingLevelRightPart = rating.AsSpan().RightPart(':');
+ if (ratingLevelRightPart.Length != 0)
+ {
+ return GetRatingLevel(ratingLevelRightPart.ToString());
+ }
}
// Handle prefix country code to handle "DE-18"
@@ -332,8 +336,12 @@ namespace Emby.Server.Implementations.Localization
// Extract culture from country prefix
var culture = FindLanguageInfo(ratingSpan.LeftPart('-').ToString());
- // Check rating system of culture
- return GetRatingLevel(ratingSpan.RightPart('-').ToString(), culture?.TwoLetterISOLanguageName);
+ var ratingLevelRightPart = ratingSpan.RightPart('-');
+ if (ratingLevelRightPart.Length != 0)
+ {
+ // Check rating system of culture
+ return GetRatingLevel(ratingLevelRightPart.ToString(), culture?.TwoLetterISOLanguageName);
+ }
}
return null;