feat(recipes): add 'Has Workflow' filter to the recipes filter panel

This commit is contained in:
Will Miao
2026-10-10 08:33:54 +08:00
parent af90fe873d
commit 587d952604
18 changed files with 391 additions and 12 deletions
+3
View File
@@ -308,6 +308,9 @@ class RecipeListingHandler:
if lora_availability:
filters["lora_availability"] = lora_availability
if request.query.get("has_workflow", "").lower() == "true":
filters["has_workflow"] = True
lora_hash = request.query.get("lora_hash")
checkpoint_hash = request.query.get("checkpoint_hash")
+6
View File
@@ -3738,6 +3738,12 @@ class RecipeScanner:
if self._compute_availability_statuses(item) & selected
]
# Filter by embedded workflow presence
if filters.get("has_workflow"):
filtered_data = [
item for item in filtered_data if item.get("has_workflow")
]
# Apply sorting if not already handled by pre-sorted cache
if ":" in sort_by or sort_field in ("loras_count", "random", "opened"):
field, order = (sort_by.split(":") + ["desc"])[:2]