diff --git a/trilium_api.py b/trilium_api.py index 9e40aae..69d673a 100644 --- a/trilium_api.py +++ b/trilium_api.py @@ -79,11 +79,15 @@ def get_children(note_id: str) -> list: # Recherche # --------------------------------------------------------------------------- -def search_notes(query: str, limit: int = 50) -> list: - result = _ea().search_note(search=query, limit=limit) +def search_notes(query: str, limit: int = None) -> list: + # limit=None : pas de plafond (ETAPI renvoie tout). Un limit explicite plafonne volontairement. + if limit is None: + result = _ea().search_note(search=query) + else: + result = _ea().search_note(search=query, limit=limit) return result.get("results", []) if isinstance(result, dict) else [] -def search_by_label(label: str, value: str = "", limit: int = 50) -> list: +def search_by_label(label: str, value: str = "", limit: int = None) -> list: query = f"#{label}" if not value else f"#{label}={value}" return search_notes(query, limit)