Initial advanced filtering#218
Conversation
im assuming here cat and dog and such refer to any kind of filter, so something like |
|
Yeah I was just using that for examples. They could be any filter. |
|
I've added most of the filters I could think of, and it seems stable now.
|
this is incredibly impressive, amazing work! and in just 370 lines too! one thing i will note is number, string, and date filters might benefit from
last thing is |
|
:, =, and == are completely interchangeable. Forgot to mention that part. |
|
got it to crash... repeatable. The intention was to filter Exception has occurred: TypeError
'in <string>' requires string as left operand, not Type
File "Y:\Code\VN\FaceCrap-Filters\modules\utils.py", line 549, in <genexpr>
key = lambda game, f: (and_or(attr_for(f.token, game) in node.token for node in f.nodes))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "Y:\Code\VN\FaceCrap-Filters\modules\utils.py", line 549, in <lambda>
key = lambda game, f: (and_or(attr_for(f.token, game) in node.token for node in f.nodes))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "Y:\Code\VN\FaceCrap-Filters\modules\utils.py", line 597, in <lambda>
base_ids = set(filter(functools.partial(lambda f, k, id: f.invert != k(globals.games[id], f), head, key), base_ids))
^^^^^^^^^^^^^^^^^^^^^^^
File "Y:\Code\VN\FaceCrap-Filters\modules\utils.py", line 597, in parse_query
base_ids = set(filter(functools.partial(lambda f, k, id: f.invert != k(globals.games[id], f), head, key), base_ids))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "Y:\Code\VN\FaceCrap-Filters\modules\gui.py", line 3008, in calculate_ids
base_ids = utils.parse_query(query, base_ids)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "Y:\Code\VN\FaceCrap-Filters\modules\gui.py", line 3160, in draw_games_list
self.calculate_ids(table_id, imgui.table_get_sort_specs())
File "Y:\Code\VN\FaceCrap-Filters\modules\gui.py", line 955, in main_loop
self.draw_games_list()
File "Y:\Code\VN\FaceCrap-Filters\main-debug.py", line 50, in main
globals.gui.main_loop()
File "Y:\Code\VN\FaceCrap-Filters\main-debug.py", line 95, in <module>
main()
TypeError: 'in <string>' requires string as left operand, not TypeIt will bomb on everything typed after Again, not being 100% sure on syntax I next tried Exception has occurred: TypeError
'in <string>' requires string as left operand, not Status
#
# lines removed because they are identical to the previous stack trace, just different cause
#
TypeError: 'in <string>' requires string as left operand, not StatusSeems there needs to be some kind of safeguarding if arguments consisting of enums are used. About filtering on images... it's now linked to the same enum as filtering on exes. But there's also this... except aiohttp.ClientResponseError as exc:
if exc.status < 400:
raise # Not error status
if image_url.startswith("https://i.imgur.com"):
thread["image_url"] = "blocked"
else:
thread["image_url"] = "dead" |
Thank you, fixed this (as well as for Status and Tab)
Syntax for this would be Anything like
I don't understand this part. Neither images nor exes use enums, and that code is not something I wrote. |
if check_host(f95_domain) and not check_host(get_url_domain(image_url)):
# Link is actually dead
thread["image_url"] = "dead"I know you did not write both bits, the reason I referred to it is because these two values could end up someone's data. But they can't be filtered against. |
Ok I understand now. I've added a filter for |



Implementing #55
Turns the search bar into a filter bar with support for logical searches (AND, OR, NOT).
I don't think it's very stable right now, but it works if you don't try to break it.It is stable, but it can probably still be broken. Don't have the time to try breaking it really hard.
Formatting
tag:{tagname}- Defaults toANDtag:({tag1} or {tag2} or ...)label:"{labelname}"- Requires quotes if label has spacescat or dogcat | dogcat || dog- Any of these work forORstatus:complete- All currently supported filters are implementedcat or (dog and (fox or squirrel))- Nesting is supportedI will be adding support for inequalities (Added> >= < <=) and some other filtering options