app/core/note_payload.py aktualisiert
All checks were successful
Deploy mindnet to llm-node / deploy (push) Successful in 3s
All checks were successful
Deploy mindnet to llm-node / deploy (push) Successful in 3s
This commit is contained in:
parent
3374c41f07
commit
f1f4358dee
|
|
@ -26,10 +26,18 @@ except Exception:
|
||||||
def _as_dict(x) -> Dict[str, Any]:
|
def _as_dict(x) -> Dict[str, Any]:
|
||||||
if isinstance(x, dict):
|
if isinstance(x, dict):
|
||||||
return dict(x)
|
return dict(x)
|
||||||
try:
|
# Versuche, ein ParsedMarkdown-ähnliches Objekt in ein Dict zu überführen
|
||||||
return dict(x or {})
|
out: Dict[str, Any] = {}
|
||||||
except Exception:
|
# bekannte Attribute übernehmen
|
||||||
return {"raw": str(x)}
|
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]]:
|
def _pick_args(*args, **kwargs) -> Tuple[Optional[str], Optional[dict]]:
|
||||||
path = kwargs.get("path") or (args[0] if args else None)
|
path = kwargs.get("path") or (args[0] if args else None)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user