Register file_hash with metadata and persist to disk.
(self, file_hash: str, metadata: dict)
| 79 | # ------------------------------------------------------------------ |
| 80 | |
| 81 | def add(self, file_hash: str, metadata: dict) -> None: |
| 82 | """Register file_hash with metadata and persist to disk.""" |
| 83 | self._data[file_hash] = metadata |
| 84 | self._persist() |
| 85 | |
| 86 | def remove_by_doc_name(self, doc_name: str) -> bool: |
| 87 | """Remove the entry whose metadata['doc_name'] matches. Returns True if removed.""" |