Load library from disk
(self)
| 32 | self._load_library() |
| 33 | |
| 34 | def _load_library(self): |
| 35 | """Load library from disk""" |
| 36 | if self.library_file.exists(): |
| 37 | try: |
| 38 | with open(self.library_file, 'r') as f: |
| 39 | data = json.load(f) |
| 40 | self.notebooks = data.get('notebooks', {}) |
| 41 | self.active_notebook_id = data.get('active_notebook_id') |
| 42 | print(f"📚 Loaded library with {len(self.notebooks)} notebooks") |
| 43 | except Exception as e: |
| 44 | print(f"⚠️ Error loading library: {e}") |
| 45 | self.notebooks = {} |
| 46 | self.active_notebook_id = None |
| 47 | else: |
| 48 | self._save_library() |
| 49 | |
| 50 | def _save_library(self): |
| 51 | """Save library to disk""" |