feat: tag management — scrape, edit, search existing, import to Mealie/Tandoor
- Scraper extracts tags from mindmegette.hu (<a class="tag">) and schema.org keywords - Tag editor UI with removable chips, search/autocomplete for existing tags, custom add - Mealie: auto-create tags via POST /api/organizers/tags, include in recipe PATCH - Tandoor: include keywords in recipe POST (auto-created by name) - New GET /tags endpoint returns existing tags from both services for search Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+23
@@ -171,6 +171,29 @@ def send_to_tandoor():
|
||||
return jsonify({"ok": False, "error": str(exc), "trace": traceback.format_exc()})
|
||||
|
||||
|
||||
@app.route("/tags", methods=["GET"])
|
||||
def list_all_tags():
|
||||
"""Return existing tags from Mealie and Tandoor for autocomplete."""
|
||||
cfg = config.load()
|
||||
mealie_tags = []
|
||||
tandoor_tags = []
|
||||
if cfg.get("mealie_url") and cfg.get("mealie_api_key"):
|
||||
try:
|
||||
client = MealieClient(cfg["mealie_url"], cfg["mealie_api_key"],
|
||||
api_url=config.MEALIE_INTERNAL_URL)
|
||||
mealie_tags = [t["name"] for t in client.list_tags()]
|
||||
except Exception:
|
||||
pass
|
||||
if cfg.get("tandoor_url") and cfg.get("tandoor_api_key"):
|
||||
try:
|
||||
client = TandoorClient(cfg["tandoor_url"], cfg["tandoor_api_key"],
|
||||
api_url=config.TANDOOR_INTERNAL_URL)
|
||||
tandoor_tags = [t["name"] for t in client.list_keywords()]
|
||||
except Exception:
|
||||
pass
|
||||
return jsonify({"mealie": mealie_tags, "tandoor": tandoor_tags})
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Health
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user