This commit is contained in:
2026-01-15 03:20:52 -08:00
parent 3a02a52863
commit dabc8f9d51
3 changed files with 313 additions and 148 deletions

View File

@@ -2002,18 +2002,26 @@ class Folder(Store):
if not self._location:
return False
file_hash = str(file_identifier or "").strip().lower()
note_name = str(name or "").strip()
if not _normalize_hash(file_hash):
return False
file_path = self.get_file(file_hash, **kwargs)
if not file_path or not isinstance(file_path,
Path) or not file_path.exists():
if not note_name:
return False
with API_folder_store(Path(self._location)) as db:
setter_hash = getattr(db, "set_note_by_hash", None)
if callable(setter_hash):
setter_hash(file_hash, note_name, str(text))
return True
file_path = self.get_file(file_hash, **kwargs)
if not file_path or not isinstance(file_path,
Path) or not file_path.exists():
return False
setter = getattr(db, "set_note", None)
if callable(setter):
setter(file_path, str(name), str(text))
setter(file_path, note_name, str(text))
return True
db.save_note(file_path, str(text))
return True