Skip to content

Commit

Permalink
finish refactoring of FilterState
Browse files Browse the repository at this point in the history
  • Loading branch information
Computerdores committed Nov 28, 2024
1 parent ea17580 commit 83e156f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
14 changes: 0 additions & 14 deletions tagstudio/src/core/library/alchemy/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,9 @@ class FilterState:
page_size: int | None = 500

# these should be erased on update
# whole path
path: Path | str | None = None

# Abstract Syntax Tree Of the current Search Query
ast: Query = None

def __post_init__(self):
# strip values automatically

query = None

if self.path is not None:
query = f"path:'{str(self.path).strip()}'"

if query is not None:
self.ast = Parser(query).parse()

@property
def limit(self):
return self.page_size
Expand Down
3 changes: 0 additions & 3 deletions tagstudio/src/core/library/alchemy/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,9 +447,6 @@ def search_library(
.outerjoin(TagAlias)
.where(SQLBoolExpressionBuilder().visit(search.ast))
)
elif search.path:
search_str = str(search.path).replace("*", "%")
statement = statement.where(Entry.path.ilike(search_str))

extensions = self.prefs(LibraryPrefs.EXTENSION_LIST)
is_exclude_list = self.prefs(LibraryPrefs.IS_EXCLUDE_LIST)
Expand Down

0 comments on commit 83e156f

Please sign in to comment.