mirror of
				https://github.com/Kareadita/Kavita.git
				synced 2025-10-31 18:47:05 -04:00 
			
		
		
		
	
		
			
				
	
	
		
			23 lines
		
	
	
		
			517 B
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			517 B
		
	
	
	
		
			C#
		
	
	
	
	
	
| using System;
 | |
| using System.Collections.Generic;
 | |
| using API.DTOs.Filtering;
 | |
| using API.Entities.Enums;
 | |
| 
 | |
| namespace API.Extensions;
 | |
| #nullable enable
 | |
| 
 | |
| public static class FilterDtoExtensions
 | |
| {
 | |
|     private static readonly IList<MangaFormat> AllFormats = Enum.GetValues<MangaFormat>();
 | |
| 
 | |
|     public static IList<MangaFormat> GetSqlFilter(this FilterDto filter)
 | |
|     {
 | |
|         if (filter.Formats == null || filter.Formats.Count == 0)
 | |
|         {
 | |
|             return AllFormats;
 | |
|         }
 | |
| 
 | |
|         return filter.Formats;
 | |
|     }
 | |
| }
 |