fix: update recipe data structure to include source_path from metadata and improve loading messages

This commit is contained in:
Will Miao
2025-05-05 18:15:59 +08:00
parent 2b405ae164
commit 71b97d5974
3 changed files with 23 additions and 7 deletions

View File

@@ -550,7 +550,7 @@ class RecipeRoutes:
with open(image_path, 'wb') as f:
f.write(optimized_image)
# Create the recipe JSON
# Create the recipe data structure
current_time = time.time()
# Format loras data according to the recipe.json format
@@ -606,6 +606,10 @@ class RecipeRoutes:
if tags:
recipe_data["tags"] = tags
# Add source_path if provided in metadata
if metadata.get("source_path"):
recipe_data["source_path"] = metadata.get("source_path")
# Save the recipe JSON
json_filename = f"{recipe_id}.recipe.json"
json_path = os.path.join(recipes_dir, json_filename)