Skip to content

Commit

Permalink
Trim Expression, Function, and Selector from FilterConditions in APIv3
Browse files Browse the repository at this point in the history
  • Loading branch information
da3dsoul committed Dec 4, 2023
1 parent b0e81f4 commit c73f085
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Shoko.Server/API/v3/Helpers/FilterFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ public Filter.FilterCondition GetExpressionTree(FilterExpression expression)
public FilterExpression<T> GetExpressionTree<T>(Filter.FilterCondition condition)
{
if (condition is null) return null;
if (!_expressionTypes.TryGetValue(condition.Type, out var type)) throw new ArgumentException($"FilterCondition type {condition.Type} was not found");
if (!_expressionTypes.TryGetValue(condition.Type.Replace("Expression", "").Replace("Function", "").Replace("Selector", ""), out var type))
throw new ArgumentException($"FilterCondition type {condition.Type} was not found");
var result = (FilterExpression<T>)Activator.CreateInstance(type);

// Left/First
Expand Down

0 comments on commit c73f085

Please sign in to comment.