From a3577ddd2227aa8d4591a36ce2cd80605b2c8ba8 Mon Sep 17 00:00:00 2001 From: bouni Date: Fri, 2 Aug 2024 08:20:54 +0200 Subject: [PATCH] Post filter search results --- library.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.py b/library.py index 0ea14dd..024a5a3 100644 --- a/library.py +++ b/library.py @@ -391,7 +391,7 @@ def get_part_details(self, lcsc: list) -> dict: # Use parameter binding to prevent SQL injection and handle the query more efficiently for number in lcsc: cur.execute(query, {"number": number}) - results.extend(cur.fetchall()) + results.extend([x for x in cur.fetchall() if x[0] == number]) # Filter exact match as FTS5 does return every match if results: return results[0] return {}