From d64e18b69a0a6089aab350f33464f362f09de942 Mon Sep 17 00:00:00 2001 From: Shadowghost Date: Wed, 29 Jul 2026 09:35:20 +0200 Subject: Fix more filter cases --- .../Extensions/ExpressionExtensions.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'Jellyfin.Server.Implementations/Extensions/ExpressionExtensions.cs') diff --git a/Jellyfin.Server.Implementations/Extensions/ExpressionExtensions.cs b/Jellyfin.Server.Implementations/Extensions/ExpressionExtensions.cs index d70ac672f2..0f166fc6e0 100644 --- a/Jellyfin.Server.Implementations/Extensions/ExpressionExtensions.cs +++ b/Jellyfin.Server.Implementations/Extensions/ExpressionExtensions.cs @@ -39,6 +39,19 @@ public static class ExpressionExtensions return predicates.Aggregate((aggregatePredicate, nextPredicate) => aggregatePredicate.Or(nextPredicate)); } + /// + /// Negates a predicate. + /// + /// The predicate parameter type. + /// The predicate expression to negate. + /// A new expression representing the negation of the input predicate. + public static Expression> Not(this Expression> predicate) + { + ArgumentNullException.ThrowIfNull(predicate); + + return Expression.Lambda>(Expression.Not(predicate.Body), predicate.Parameters); + } + /// /// Combines two predicates into a single predicate using a logical AND operation. /// -- cgit v1.2.3