aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Controllers/LocalizationController.cs
diff options
context:
space:
mode:
authorJoshua M. Boniface <joshua@boniface.me>2025-08-03 17:29:40 -0400
committerGitHub <noreply@github.com>2025-08-03 17:29:40 -0400
commit1262ac31dce4a0d59a427312baeade9a846b5b91 (patch)
treefb3b3c19620a8002c4620cff5964f495fa3e21c3 /Jellyfin.Api/Controllers/LocalizationController.cs
parent0f5bb5cf767e8c5a767be32e26016cae17ae341c (diff)
parent2007815fa6b592984a64a6d3d978d41ae8f7347b (diff)
Merge pull request #14410 from dyphire/language
Further refinement of BCP 47 language labeling support
Diffstat (limited to 'Jellyfin.Api/Controllers/LocalizationController.cs')
-rw-r--r--Jellyfin.Api/Controllers/LocalizationController.cs11
1 files changed, 10 insertions, 1 deletions
diff --git a/Jellyfin.Api/Controllers/LocalizationController.cs b/Jellyfin.Api/Controllers/LocalizationController.cs
index bbce5a9e1..dd8f935dc 100644
--- a/Jellyfin.Api/Controllers/LocalizationController.cs
+++ b/Jellyfin.Api/Controllers/LocalizationController.cs
@@ -1,4 +1,6 @@
+using System;
using System.Collections.Generic;
+using System.Linq;
using MediaBrowser.Common.Api;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Globalization;
@@ -34,7 +36,14 @@ public class LocalizationController : BaseJellyfinApiController
[ProducesResponseType(StatusCodes.Status200OK)]
public ActionResult<IEnumerable<CultureDto>> GetCultures()
{
- return Ok(_localization.GetCultures());
+ var allCultures = _localization.GetCultures();
+
+ var distinctCultures = allCultures
+ .DistinctBy(c => c.DisplayName, StringComparer.OrdinalIgnoreCase)
+ .OrderBy(c => c.DisplayName)
+ .AsEnumerable();
+
+ return Ok(distinctCultures);
}
/// <summary>