The Free Software Media System - Server Backend & API
Simplify conditional expression
Stepan Goremykinb6cfdb8b9265
diff --git a/Emby.Server.Implementations/Dto/DtoService.cs b/Emby.Server.Implementations/Dto/DtoService.csindex c725839fba..8fa2f05662 100644--- a/Emby.Server.Implementations/Dto/DtoService.cs+++ b/Emby.Server.Implementations/Dto/DtoService.cs@@ -571,9 +571,7 @@ namespace Emby.Server.Implementations.Dtoreturn null;}}).Where(i => i is not null)- .Where(i => user is null ?- true :- i.IsVisible(user))+ .Where(i => user is null || i.IsVisible(user)).DistinctBy(x => x.Name, StringComparer.OrdinalIgnoreCase).ToDictionary(i => i.Name, StringComparer.OrdinalIgnoreCase);diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.csindex 36a300a572..8883aff0b0 100644--- a/Emby.Server.Implementations/Library/LibraryManager.cs+++ b/Emby.Server.Implementations/Library/LibraryManager.cs@@ -2749,9 +2749,7 @@ namespace Emby.Server.Implementations.Library}}).Where(i => i is not null)- .Where(i => query.User is null ?- true :- i.IsVisible(query.User))+ .Where(i => query.User is null || i.IsVisible(query.User)).ToList();}diff --git a/Jellyfin.Server/Migrations/Routines/MigrateDisplayPreferencesDb.cs b/Jellyfin.Server/Migrations/Routines/MigrateDisplayPreferencesDb.csindex 7c4ffdbc00..8fe2b087d9 100644--- a/Jellyfin.Server/Migrations/Routines/MigrateDisplayPreferencesDb.cs+++ b/Jellyfin.Server/Migrations/Routines/MigrateDisplayPreferencesDb.cs@@ -133,9 +133,7 @@ namespace Jellyfin.Server.Migrations.RoutinesSkipBackwardLength = dto.CustomPrefs.TryGetValue("skipBackLength", out length) && int.TryParse(length, out var skipBackwardLength)? skipBackwardLength: 10000,- EnableNextVideoInfoOverlay = dto.CustomPrefs.TryGetValue("enableNextVideoInfoOverlay", out var enabled) && !string.IsNullOrEmpty(enabled)- ? bool.Parse(enabled)- : true,+ EnableNextVideoInfoOverlay = !dto.CustomPrefs.TryGetValue("enableNextVideoInfoOverlay", out var enabled) || string.IsNullOrEmpty(enabled) || bool.Parse(enabled),DashboardTheme = dto.CustomPrefs.TryGetValue("dashboardtheme", out var theme) ? theme : string.Empty,TvHome = dto.CustomPrefs.TryGetValue("tvhome", out var home) ? home : string.Empty};