Skip to content

Commit

Permalink
Merge pull request jellyfin#11698 from Bond-009/issue11605
Browse files Browse the repository at this point in the history
Fix not binding to SQL parameters
  • Loading branch information
nielsvanvelzen committed May 17, 2024
2 parents 26714e2 + dd0ab8e commit d303ca5
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions Emby.Server.Implementations/Data/SqliteItemRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2323,7 +2323,7 @@ SELECT albumValues.ItemId

columns.Add(builder.ToString());

query.ExcludeItemIds = [..query.ExcludeItemIds, item.Id, ..item.ExtraIds];
query.ExcludeItemIds = [.. query.ExcludeItemIds, item.Id, .. item.ExtraIds];
query.ExcludeProviderIds = item.ProviderIds;
}

Expand Down Expand Up @@ -2831,7 +2831,7 @@ private string GetOrderByText(InternalItemsQuery query)
prepend.Add((ItemSortBy.Random, SortOrder.Ascending));
}

orderBy = query.OrderBy = [..prepend, ..orderBy];
orderBy = query.OrderBy = [.. prepend, .. orderBy];
}
else if (orderBy.Count == 0)
{
Expand Down Expand Up @@ -5144,7 +5144,7 @@ private List<(int MagicNumber, string Value)> GetItemValuesToSave(BaseItem item,
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;
}
Expand Down Expand Up @@ -5202,12 +5202,6 @@ private void InsertItemValues(Guid id, List<(int MagicNumber, string Value)> val

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));
Expand Down

0 comments on commit d303ca5

Please sign in to comment.