From 93d7a1cf20442e4a82b2819f8a5bdbe4f6c0ae97 Mon Sep 17 00:00:00 2001 From: Shadowghost Date: Mon, 4 May 2026 23:57:34 +0200 Subject: Cleanup --- .../HttpServer/WebSocketConnection.cs | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'Emby.Server.Implementations/HttpServer/WebSocketConnection.cs') diff --git a/Emby.Server.Implementations/HttpServer/WebSocketConnection.cs b/Emby.Server.Implementations/HttpServer/WebSocketConnection.cs index 17070c39ba..e9bf3b93a7 100644 --- a/Emby.Server.Implementations/HttpServer/WebSocketConnection.cs +++ b/Emby.Server.Implementations/HttpServer/WebSocketConnection.cs @@ -71,9 +71,9 @@ namespace Emby.Server.Implementations.HttpServer public IPAddress? RemoteEndPoint { get; } /// - /// Gets or initializes the UI culture name captured from the upgrade request. + /// Gets or initializes the UI culture captured from the upgrade request. /// - public string? RequestUICulture { get; init; } + public CultureInfo? RequestUICulture { get; init; } /// public Func? OnReceive { get; set; } @@ -90,19 +90,12 @@ namespace Emby.Server.Implementations.HttpServer /// public void ApplyRequestCulture() { - if (string.IsNullOrEmpty(RequestUICulture)) + if (RequestUICulture is null) { return; } - try - { - CultureInfo.CurrentUICulture = CultureInfo.GetCultureInfo(RequestUICulture); - } - catch (CultureNotFoundException) - { - // Codes that aren't valid .NET cultures are ignored. - } + CultureInfo.CurrentUICulture = RequestUICulture; } /// -- cgit v1.2.3