diff options
| author | Neil Burrows <neil.burrows@nvable.com> | 2019-12-13 13:45:04 +0000 |
|---|---|---|
| committer | Neil Burrows <neil.burrows@nvable.com> | 2019-12-13 13:45:20 +0000 |
| commit | 55317b5c749a36411f6582f8cf6a9477f1a2c880 (patch) | |
| tree | 92bd8831f203cf57eea13247937b12b11dd95505 /Emby.Server.Implementations/Data/SqliteItemRepository.cs | |
| parent | 12bb4a92eb69a0dfe06add8f4aebf5da749c6126 (diff) | |
Fixing index error & split out code for readability
Diffstat (limited to 'Emby.Server.Implementations/Data/SqliteItemRepository.cs')
| -rw-r--r-- | Emby.Server.Implementations/Data/SqliteItemRepository.cs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Emby.Server.Implementations/Data/SqliteItemRepository.cs b/Emby.Server.Implementations/Data/SqliteItemRepository.cs index 2a74a826b..b664738cb 100644 --- a/Emby.Server.Implementations/Data/SqliteItemRepository.cs +++ b/Emby.Server.Implementations/Data/SqliteItemRepository.cs @@ -4596,14 +4596,19 @@ namespace Emby.Server.Implementations.Data var paramName = "@ExcludeInheritedTags"; if (statement == null) { - int index = 0; - whereClauses.Add("((select CleanValue from itemvalues where ItemId=Guid and Type=6 and cleanvalue in (" + string.Join(",", query.ExcludeInheritedTags.Select(t => paramName + index++)) + ")) is null)"); + List<string> paramList = new List<string>(); + for (int index = 0; index < query.ExcludeInheritedTags.Length; index++) + { + paramList.Add(paramName + index); + } + + whereClauses.Add("((select CleanValue from itemvalues where ItemId=Guid and Type=6 and cleanvalue in (" + string.Join(",", paramList) + ")) is null)"); } else { for (int index = 0; index < query.ExcludeInheritedTags.Length; index++) { - statement.TryBind(paramName + index, GetCleanValue(query.ExcludeInheritedTags[0])); + statement.TryBind(paramName + index, GetCleanValue(query.ExcludeInheritedTags[index])); } } } |
