Skip to content

Commit

Permalink
Making it uptodate with main tagstudio branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Nginearing authored Nov 30, 2024
1 parent 7f15c3f commit 09c6ebf
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tagstudio/src/core/library/alchemy/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ class FilterState:
path: Path | str | None = None
# file name
name: str | None = None

# file type
filetype: str | None = None
mediatype: str | None = None

# a generic query to be parsed
query: str | None = None

Expand All @@ -87,6 +90,7 @@ def __post_init__(self):
# parse the value
if ":" in query:
kind, _, value = query.partition(":")
value = value.replace('"', "")
else:
# default to tag search
kind, value = "tag", query
Expand All @@ -101,6 +105,10 @@ def __post_init__(self):
self.name = value
elif kind == "id":
self.id = int(self.id) if str(self.id).isnumeric() else self.id
elif kind == "filetype":
self.filetype = value
elif kind == "mediatype":
self.mediatype = value

else:
self.tag = self.tag and self.tag.strip()
Expand Down

0 comments on commit 09c6ebf

Please sign in to comment.