From dd0ab8ed56b75556cd1a2993abbd92ab4838499b Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Fri, 17 May 2024 18:35:11 +0200 Subject: [PATCH] Fix not binding to SQL parameters Whitespace values weren't being filtered out in advance Remove the posibility of this happening again by always binding Should fix #11605 --- .../Data/SqliteItemRepository.cs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs index 9ef1bd66d..34d753093 100644 --- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs +++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs @@ -2323,7 +2323,7 @@ namespace Emby.Server.Implementations.Data columns.Add(builder.ToString()); - query.ExcludeItemIds = [..query.ExcludeItemIds, item.Id, ..item.ExtraIds]; + query.ExcludeItemIds = [.. query.ExcludeItemIds, item.Id, .. item.ExtraIds]; query.ExcludeProviderIds = item.ProviderIds; } @@ -2831,7 +2831,7 @@ namespace Emby.Server.Implementations.Data prepend.Add((ItemSortBy.Random, SortOrder.Ascending)); } - orderBy = query.OrderBy = [..prepend, ..orderBy]; + orderBy = query.OrderBy = [.. prepend, .. orderBy]; } else if (orderBy.Count == 0) { @@ -5144,7 +5144,7 @@ AND Type = @InternalPersonType)"); list.AddRange(inheritedTags.Select(i => (6, i))); // Remove all invalid values. - list.RemoveAll(i => string.IsNullOrEmpty(i.Item2)); + list.RemoveAll(i => string.IsNullOrWhiteSpace(i.Item2)); return list; } @@ -5202,12 +5202,6 @@ AND Type = @InternalPersonType)"); var itemValue = currentValueInfo.Value; - // Don't save if invalid - if (string.IsNullOrWhiteSpace(itemValue)) - { - continue; - } - statement.TryBind("@Type" + index, currentValueInfo.MagicNumber); statement.TryBind("@Value" + index, itemValue); statement.TryBind("@CleanValue" + index, GetCleanValue(itemValue));