mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-06-23 15:30:34 -04:00
Cleaning up
This commit is contained in:
parent
6bdd363b7b
commit
aa63c9e8f2
@ -277,7 +277,7 @@ namespace Kyoo
|
|||||||
? null
|
? null
|
||||||
: Convert.ChangeType(value, propertyType);
|
: Convert.ChangeType(value, propertyType);
|
||||||
ConstantExpression valueExpr = Expression.Constant(val, property.PropertyType);
|
ConstantExpression valueExpr = Expression.Constant(val, property.PropertyType);
|
||||||
|
|
||||||
Expression condition = operand switch
|
Expression condition = operand switch
|
||||||
{
|
{
|
||||||
"eq" => Expression.Equal(propertyExpr, valueExpr),
|
"eq" => Expression.Equal(propertyExpr, valueExpr),
|
||||||
@ -286,8 +286,6 @@ namespace Kyoo
|
|||||||
"lte" => StringCompatibleExpression(Expression.LessThanOrEqual, propertyExpr, valueExpr),
|
"lte" => StringCompatibleExpression(Expression.LessThanOrEqual, propertyExpr, valueExpr),
|
||||||
"gt" => StringCompatibleExpression(Expression.GreaterThan, propertyExpr, valueExpr),
|
"gt" => StringCompatibleExpression(Expression.GreaterThan, propertyExpr, valueExpr),
|
||||||
"gte" => StringCompatibleExpression(Expression.GreaterThanOrEqual, propertyExpr, valueExpr),
|
"gte" => StringCompatibleExpression(Expression.GreaterThanOrEqual, propertyExpr, valueExpr),
|
||||||
// TODO Implement the Like expression
|
|
||||||
"like" => throw new NotImplementedException("Like not implemented yet"),
|
|
||||||
_ => throw new ArgumentException($"Invalid operand: {operand}")
|
_ => throw new ArgumentException($"Invalid operand: {operand}")
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -92,7 +92,8 @@ namespace Kyoo.Controllers
|
|||||||
(ParameterExpression)((MemberExpression)sortKey.Body).Expression
|
(ParameterExpression)((MemberExpression)sortKey.Body).Expression
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
query = query.Take(page.Count);
|
if (page.Count > 0)
|
||||||
|
query = query.Take(page.Count);
|
||||||
|
|
||||||
return await query.ToListAsync();
|
return await query.ToListAsync();
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ namespace Kyoo
|
|||||||
options.UseLazyLoadingProxies()
|
options.UseLazyLoadingProxies()
|
||||||
.UseNpgsql(_configuration.GetConnectionString("Database"));
|
.UseNpgsql(_configuration.GetConnectionString("Database"));
|
||||||
// .EnableSensitiveDataLogging()
|
// .EnableSensitiveDataLogging()
|
||||||
// .UseLoggerFactory(LoggerFactory.Create(builder => builder.AddConsole()));
|
//.UseLoggerFactory(LoggerFactory.Create(builder => builder.AddConsole()));
|
||||||
}, ServiceLifetime.Transient);
|
}, ServiceLifetime.Transient);
|
||||||
|
|
||||||
services.AddDbContext<IdentityDatabase>(options =>
|
services.AddDbContext<IdentityDatabase>(options =>
|
||||||
|
@ -48,7 +48,7 @@ namespace Kyoo.Api
|
|||||||
where.Remove("sortBy");
|
where.Remove("sortBy");
|
||||||
where.Remove("limit");
|
where.Remove("limit");
|
||||||
where.Remove("afterID");
|
where.Remove("afterID");
|
||||||
if (limit <= 0)
|
if (limit == 0)
|
||||||
limit = 20;
|
limit = 20;
|
||||||
|
|
||||||
ICollection<Show> shows;
|
ICollection<Show> shows;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user