aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Förtsch <mail@felixfoertsch.de>2026-09-02 11:05:36 +0200
committerGitHub <noreply@github.com>2026-09-02 11:05:36 +0200
commit3df58ab775eeff53c8476d5ae833f701e2ae1bb9 (patch)
treedcbc2b0ae376fced5017d89803e30e8bf4ae993e
parent145258865adb5904c9598d1e3e84412204f95b02 (diff)
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
-rw-r--r--tests/Jellyfin.Server.Implementations.Tests/Item/BaseItemRepositoryLegacyFilterTests.cs24
1 files changed, 12 insertions, 12 deletions
diff --git a/tests/Jellyfin.Server.Implementations.Tests/Item/BaseItemRepositoryLegacyFilterTests.cs b/tests/Jellyfin.Server.Implementations.Tests/Item/BaseItemRepositoryLegacyFilterTests.cs
index 9ecd6d5458..c578714749 100644
--- a/tests/Jellyfin.Server.Implementations.Tests/Item/BaseItemRepositoryLegacyFilterTests.cs
+++ b/tests/Jellyfin.Server.Implementations.Tests/Item/BaseItemRepositoryLegacyFilterTests.cs
@@ -150,18 +150,18 @@ public sealed class BaseItemRepositoryLegacyFilterTests : IDisposable
Assert.Equal(["Alpha", "Beta"], result.Tags);
Assert.Equal(["Genre Leak"], result.Genres);
- var tagsCommand = Assert.Single(
- _interceptor.Commands,
- command => command.Contains("GROUP BY", StringComparison.Ordinal)
- && command.Contains("\"Type\" = 4", StringComparison.Ordinal));
- var genresCommand = Assert.Single(
- _interceptor.Commands,
- command => command.Contains("GROUP BY", StringComparison.Ordinal)
- && command.Contains("\"Type\" = 2", StringComparison.Ordinal));
- Assert.Equal(1, CountOccurrences(tagsCommand, "INNER JOIN \"ItemValues\""));
- Assert.DoesNotContain("SELECT (", tagsCommand, StringComparison.Ordinal);
- Assert.Equal(1, CountOccurrences(genresCommand, "INNER JOIN \"ItemValues\""));
- Assert.DoesNotContain("SELECT (", genresCommand, StringComparison.Ordinal);
+ var itemValueCommands = _interceptor.Commands
+ .Where(command => command.Contains("GROUP BY", StringComparison.Ordinal)
+ && command.Contains("INNER JOIN \"ItemValues\"", StringComparison.Ordinal))
+ .ToArray();
+
+ Assert.Equal(2, itemValueCommands.Length);
+
+ foreach (var command in itemValueCommands)
+ {
+ Assert.Equal(1, CountOccurrences(command, "INNER JOIN \"ItemValues\""));
+ Assert.DoesNotContain("SELECT (SELECT", command, StringComparison.Ordinal);
+ }
}
private static int CountOccurrences(string value, string pattern)