diff options
| author | Bond-009 <bond.009@outlook.com> | 2026-02-04 19:23:38 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-04 19:23:38 +0100 |
| commit | 9f2dc178f57ab4f59d6160efb8d816fdd81382be (patch) | |
| tree | 4e3d64b0ab4bb6bd042b61514b0fe970117e2271 | |
| parent | 32d80861211031e5ee66d5068679f43335e2bcbd (diff) | |
| parent | 613d72fa26375b29b6c5da7933feff8ace1ac54e (diff) | |
Merge pull request #16178 from theguymadmax/fix-invaild-viewtype
Skip validation for empty landing preferences
| -rw-r--r-- | Jellyfin.Api/Controllers/DisplayPreferencesController.cs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Jellyfin.Api/Controllers/DisplayPreferencesController.cs b/Jellyfin.Api/Controllers/DisplayPreferencesController.cs index 585318d24..ef54e9db5 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); } } |
