finish refactoring of FilterState

This commit is contained in:
Jann Stute
2024-11-28 22:42:01 +01:00
parent ea175800be
commit 83e156f69b
2 changed files with 0 additions and 17 deletions

View File

@@ -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

View File

@@ -447,9 +447,6 @@ class 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)