(self)
| 413 | self.data = self._load() |
| 414 | |
| 415 | def _load(self) -> dict: |
| 416 | if self.path.exists(): |
| 417 | try: |
| 418 | with open(self.path, "r", encoding="utf-8") as f: |
| 419 | return json.load(f) |
| 420 | except Exception: |
| 421 | pass |
| 422 | return {"documents": {}, "last_updated": None} |
| 423 | |
| 424 | def save(self): |
| 425 | self.path.parent.mkdir(parents=True, exist_ok=True) |