Skip to content

Commit

Permalink
Post filter search results
Browse files Browse the repository at this point in the history
  • Loading branch information
Bouni committed Aug 2, 2024
1 parent abc3891 commit a3577dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
Expand Down

0 comments on commit a3577dd

Please sign in to comment.