Squash Odysseus development history

This commit is contained in:
pewdiepie-archdaemon
2026-09-11 06:04:19 +00:00
parent e5c99a5eee
commit 6ee6502010
2050 changed files with 538359 additions and 57745 deletions
+13 -1
View File
@@ -29,12 +29,24 @@ except ModuleNotFoundError as e:
sys.exit(2)
def _load_items(raw) -> list:
if not raw:
return []
try:
items = json.loads(raw)
except (TypeError, json.JSONDecodeError):
return []
if not isinstance(items, list):
return []
return [item for item in items if isinstance(item, dict)]
def _serialize(n: "Note") -> dict:
return {
"id": n.id,
"title": n.title or "",
"content": n.content or "",
"items": json.loads(n.items) if n.items else [],
"items": _load_items(n.items),
"note_type": n.note_type or "note",
"color": n.color or "",
"label": n.label or "",