fix: image upload (add extension field) + ingredient groups

- Fix Mealie image upload 422: send required `extension` field in form data
- Parse ingredient groups from mindmegette (multiple div.ingredients
  containers with strong.ingredients-group titles)
- Show group headers in UI with dashed-border accent input
- Pass group markers through to Mealie as title-only ingredient entries

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-24 08:44:34 +01:00
parent cb669f1861
commit c235d5caa7
3 changed files with 76 additions and 11 deletions
+12 -1
View File
@@ -147,7 +147,17 @@ class MealieClient:
ingredients = []
for item in recipe.get("ingredients", []):
if isinstance(item, dict):
ingredients.append(self._build_ingredient(item))
# Group header marker
if "group" in item and "food" not in item:
ingredients.append({
"referenceId": str(uuid.uuid4()),
"title": item["group"],
"note": "",
"isFood": False,
"disableAmount": True,
})
else:
ingredients.append(self._build_ingredient(item))
else:
# Legacy: plain string
ingredients.append({
@@ -235,6 +245,7 @@ class MealieClient:
r = self.session.put(
f"{self.api_url}/api/recipes/{slug}/image",
files=files,
data={"extension": ext},
timeout=30,
)
r.raise_for_status()