(self, task_id: int)
| 55 | return max(ids) if ids else 0 |
| 56 | |
| 57 | def _load(self, task_id: int) -> dict: |
| 58 | path = self.dir / f"task_{task_id}.json" |
| 59 | if not path.exists(): |
| 60 | raise ValueError(f"Task {task_id} not found") |
| 61 | return json.loads(path.read_text()) |
| 62 | |
| 63 | def _save(self, task: dict): |
| 64 | path = self.dir / f"task_{task['id']}.json" |