From cb365bf5a685c61c5bf5a36853b6bb3a5638b3a6 Mon Sep 17 00:00:00 2001 From: Master Date: Thu, 2 Jul 2026 15:43:05 +0200 Subject: [PATCH] fix: search_by_label/search_notes tronquaient silencieusement a limit=50 limit passe a None par defaut (ETAPI renvoie tout ; un limit explicite plafonne volontairement). Corrige un bug critique : tous les briefings (contexte, backlog, decisions, historique, concepts) sous-estimaient le contenu des qu'une categorie depassait 50 notes. 96 backlogItems reels contre 50 remontes. Cause-racine du confident-but-stale. Revele en verifiant le backlog avant reprise. --- trilium_api.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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)