app/core/note_payload.py aktualisiert
All checks were successful
Deploy mindnet to llm-node / deploy (push) Successful in 3s

This commit is contained in:
Lars 2025-12-03 14:27:09 +01:00
parent 3374c41f07
commit f1f4358dee

View File

@ -26,10 +26,18 @@ except Exception:
def _as_dict(x) -> Dict[str, Any]:
if isinstance(x, dict):
return dict(x)
try:
return dict(x or {})
except Exception:
return {"raw": str(x)}
# Versuche, ein ParsedMarkdown-ähnliches Objekt in ein Dict zu überführen
out: Dict[str, Any] = {}
# bekannte Attribute übernehmen
for attr in ("frontmatter", "body", "id", "note_id", "title", "path", "tags", "type", "created", "modified", "date"):
if hasattr(x, attr):
val = getattr(x, attr)
if val is not None:
out[attr] = val
# Fallback: wenn immer noch leer, raw speichern
if not out:
out["raw"] = str(x)
return out
def _pick_args(*args, **kwargs) -> Tuple[Optional[str], Optional[dict]]:
path = kwargs.get("path") or (args[0] if args else None)