Skip to content

Commit

Permalink
Fix illogic stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
gounux committed Mar 14, 2024
1 parent 60029e8 commit ea3bde4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion qtribu/gui/dlg_contents.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,9 @@ def refresh_list(self, expand_all: bool = False) -> None:
def on_search_text_changed(self) -> None:
# do nothing if text is too small
current = self.search_line_edit.text()
if current != "":
if current == "":
self.refresh_list(expand_all=True)
return
if len(current) < 3:
return
self.refresh_list()
Expand Down
3 changes: 3 additions & 0 deletions qtribu/logic/json_feed.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ def _map_item(item: Dict[str, Any]) -> RssItem:
@staticmethod
def _matches(query: str, item: RssItem) -> bool:
"""Moteur de recherche du turfu"""
words = query.split(" ")
if len(words) > 1:
return all([JsonFeedClient._matches(w, item) for w in words])
return (
query.upper() in item.abstract.upper()
or query.upper() in ",".join(item.author).upper()
Expand Down

0 comments on commit ea3bde4

Please sign in to comment.