aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Controllers/DisplayPreferencesController.cs
diff options
context:
space:
mode:
authorShadowghost <Ghost_of_Stone@web.de>2026-02-07 14:06:53 +0100
committerShadowghost <Ghost_of_Stone@web.de>2026-02-07 14:06:53 +0100
commit00dd84035ee39b36da343e0d98d7dc83246c5f89 (patch)
treeb670a0b83ba5ca782501200c4c111b000663b32d /Jellyfin.Api/Controllers/DisplayPreferencesController.cs
parentf5d966fcc3eb3c5f8aa39a22caa8cf615029e1c5 (diff)
parentfead4acae121c1a2edacebbba860bdf4f6b56d25 (diff)
Merge remote-tracking branch 'upstream/master' into perf-rebased
Diffstat (limited to 'Jellyfin.Api/Controllers/DisplayPreferencesController.cs')
-rw-r--r--Jellyfin.Api/Controllers/DisplayPreferencesController.cs12
1 files changed, 10 insertions, 2 deletions
diff --git a/Jellyfin.Api/Controllers/DisplayPreferencesController.cs b/Jellyfin.Api/Controllers/DisplayPreferencesController.cs
index 585318d245..ef54e9db54 100644
--- a/Jellyfin.Api/Controllers/DisplayPreferencesController.cs
+++ b/Jellyfin.Api/Controllers/DisplayPreferencesController.cs
@@ -191,9 +191,17 @@ public class DisplayPreferencesController : BaseJellyfinApiController
foreach (var key in displayPreferences.CustomPrefs.Keys.Where(key => key.StartsWith("landing-", StringComparison.OrdinalIgnoreCase)))
{
- if (!Enum.TryParse<ViewType>(displayPreferences.CustomPrefs[key], true, out _))
+ var viewType = displayPreferences.CustomPrefs[key];
+
+ if (string.IsNullOrEmpty(viewType))
+ {
+ displayPreferences.CustomPrefs.Remove(key);
+ continue;
+ }
+
+ if (!Enum.TryParse<ViewType>(viewType, true, out _))
{
- _logger.LogError("Invalid ViewType: {LandingScreenOption}", displayPreferences.CustomPrefs[key]);
+ _logger.LogError("Invalid ViewType: {LandingScreenOption}", viewType);
displayPreferences.CustomPrefs.Remove(key);
}
}