feat: Add prompt search filter for recipes and fix 'Favorites' localization across multiple languages.

This commit is contained in:
Will Miao
2025-12-23 10:52:12 +08:00
parent 61816cf75d
commit bc9dd317f7
16 changed files with 125 additions and 43 deletions

View File

@@ -163,6 +163,7 @@ class RecipeListingHandler:
"tags": request.query.get("search_tags", "true").lower() == "true",
"lora_name": request.query.get("search_lora_name", "true").lower() == "true",
"lora_model": request.query.get("search_lora_model", "true").lower() == "true",
"prompt": request.query.get("search_prompt", "true").lower() == "true",
}
filters: Dict[str, Any] = {}

View File

@@ -1107,6 +1107,14 @@ class RecipeScanner:
if fuzzy_match(str(lora.get('modelName', '')), search):
return True
# Search in prompt and negative_prompt if enabled
if search_options.get('prompt', True) and 'gen_params' in item:
gen_params = item['gen_params']
if fuzzy_match(str(gen_params.get('prompt', '')), search):
return True
if fuzzy_match(str(gen_params.get('negative_prompt', '')), search):
return True
# No match found
return False