mirror of
				https://github.com/zoriya/Kyoo.git
				synced 2025-10-31 10:37:13 -04:00 
			
		
		
		
	fix casing for meilisearch filter string
This commit is contained in:
		
							parent
							
								
									ac38f2d6eb
								
							
						
					
					
						commit
						fec468401f
					
				| @ -1,5 +1,6 @@ | |||||||
| using System.ComponentModel.DataAnnotations; | using System.ComponentModel.DataAnnotations; | ||||||
| using Kyoo.Abstractions.Models.Utils; | using Kyoo.Abstractions.Models.Utils; | ||||||
|  | using static System.Text.Json.JsonNamingPolicy; | ||||||
| 
 | 
 | ||||||
| namespace Kyoo.Meiliseach; | namespace Kyoo.Meiliseach; | ||||||
| 
 | 
 | ||||||
| @ -13,13 +14,13 @@ public static class FilterExtensionMethods | |||||||
| 				=> $"({and.First.CreateMeilisearchFilter()}) AND ({and.Second.CreateMeilisearchFilter()})", | 				=> $"({and.First.CreateMeilisearchFilter()}) AND ({and.Second.CreateMeilisearchFilter()})", | ||||||
| 			Filter<T>.Or or | 			Filter<T>.Or or | ||||||
| 				=> $"({or.First.CreateMeilisearchFilter()}) OR ({or.Second.CreateMeilisearchFilter()})", | 				=> $"({or.First.CreateMeilisearchFilter()}) OR ({or.Second.CreateMeilisearchFilter()})", | ||||||
| 			Filter<T>.Gt gt => $"{gt.Property} > {gt.Value}", | 			Filter<T>.Gt gt => $"{CamelCase.ConvertName(gt.Property)} > '{gt.Value}'", | ||||||
| 			Filter<T>.Lt lt => $"{lt.Property} < {lt.Value}", | 			Filter<T>.Lt lt => $"{CamelCase.ConvertName(lt.Property)} < '{lt.Value}'", | ||||||
| 			Filter<T>.Ge ge => $"{ge.Property} >= {ge.Value}", | 			Filter<T>.Ge ge => $"{CamelCase.ConvertName(ge.Property)} >= '{ge.Value}'", | ||||||
| 			Filter<T>.Le le => $"{le.Property} <= {le.Value}", | 			Filter<T>.Le le => $"{CamelCase.ConvertName(le.Property)} <= '{le.Value}'", | ||||||
| 			Filter<T>.Eq eq => $"{eq.Property} = {eq.Value}", | 			Filter<T>.Eq eq => $"{CamelCase.ConvertName(eq.Property)} = '{eq.Value}'", | ||||||
| 			Filter<T>.Has has => $"{has.Property} = {has.Value}", | 			Filter<T>.Has has => $"{CamelCase.ConvertName(has.Property)} = '{has.Value}'", | ||||||
| 			Filter<T>.Ne ne => $"{ne.Property} != {ne.Value}", | 			Filter<T>.Ne ne => $"{CamelCase.ConvertName(ne.Property)} != '{ne.Value}'", | ||||||
| 			Filter<T>.Not not => $"NOT ({not.Filter.CreateMeilisearchFilter()})", | 			Filter<T>.Not not => $"NOT ({not.Filter.CreateMeilisearchFilter()})", | ||||||
| 			Filter<T>.CmpRandom | 			Filter<T>.CmpRandom | ||||||
| 				=> throw new ValidationException("Random comparison is not supported."), | 				=> throw new ValidationException("Random comparison is not supported."), | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user