mirror of
https://github.com/TagStudioDev/TagStudio.git
synced 2026-07-05 03:44:18 +00:00
fix: use optimized SQL when selecting non-hidden entries (#1240)
This commit is contained in:
committed by
GitHub
parent
3ffa012857
commit
4a543396ae
@@ -1193,7 +1193,11 @@ class Library:
|
||||
ast = search.ast
|
||||
|
||||
if not search.show_hidden_entries:
|
||||
statement = statement.where(~Entry.tags.any(Tag.is_hidden))
|
||||
hidden_tag_ids = select(Tag.id).where(Tag.is_hidden)
|
||||
hidden_entry_ids = select(TagEntry.entry_id).where(
|
||||
TagEntry.tag_id.in_(hidden_tag_ids)
|
||||
)
|
||||
statement = statement.where(Entry.id.not_in(hidden_entry_ids))
|
||||
|
||||
if ast:
|
||||
start_time = time.time()
|
||||
|
||||
Reference in New Issue
Block a user