Refactor search functionality in Lora and Recipe scanners to utilize fuzzy matching

- Introduced a new fuzzy_match utility function for improved search accuracy across Lora and Recipe scanners.
- Updated search logic in LoraScanner and RecipeScanner to leverage fuzzy matching for titles, tags, and filenames, enhancing user experience.
- Removed deprecated search methods to streamline the codebase and improve maintainability.
- Adjusted API routes to ensure compatibility with the new search options, including recursive search handling.
This commit is contained in:
Will Miao
2025-03-20 16:55:51 +08:00
parent 19ff2ebfe1
commit 607ab35cce
7 changed files with 98 additions and 106 deletions

View File

@@ -68,7 +68,6 @@ class RecipeRoutes:
async def get_recipes(self, request: web.Request) -> web.Response:
"""API endpoint for getting paginated recipes"""
try:
logger.info(f"get_recipes, Request: {request}")
# Get query parameters with defaults
page = int(request.query.get('page', '1'))
page_size = int(request.query.get('page_size', '20'))
@@ -100,7 +99,6 @@ class RecipeRoutes:
'lora_model': search_lora_model
}
logger.info(f"get_recipes, Filters: {filters}, Search Options: {search_options}")
# Get paginated data
result = await self.recipe_scanner.get_paginated_data(
page=page,