diff --git a/src/tagstudio/core/library/alchemy/library.py b/src/tagstudio/core/library/alchemy/library.py index 08d9f66ef..fe9d4e297 100644 --- a/src/tagstudio/core/library/alchemy/library.py +++ b/src/tagstudio/core/library/alchemy/library.py @@ -96,16 +96,15 @@ DB_VERSION: int = 100 TAG_CHILDREN_QUERY = text(""" --- Note for this entire query that tag_parents.child_id is the parent id and tag_parents.parent_id is the child id due to bad naming WITH RECURSIVE ChildTags AS ( - SELECT :tag_id AS child_id + SELECT :tag_id AS tag_id UNION - SELECT tp.parent_id AS child_id + SELECT tp.child_id AS tag_id FROM tag_parents tp - INNER JOIN ChildTags c ON tp.child_id = c.child_id + INNER JOIN ChildTags c ON tp.parent_id = c.tag_id ) SELECT * FROM ChildTags; -""") # noqa: E501 +""") class ReservedNamespaceError(Exception): diff --git a/src/tagstudio/core/library/alchemy/visitors.py b/src/tagstudio/core/library/alchemy/visitors.py index bf2e5b5ea..5916cd840 100644 --- a/src/tagstudio/core/library/alchemy/visitors.py +++ b/src/tagstudio/core/library/alchemy/visitors.py @@ -40,7 +40,7 @@ INNER JOIN ChildTags c ON tp.parent_id = c.tag_id ) SELECT tag_id FROM ChildTags; -""") # noqa: E501 +""") def get_filetype_equivalency_list(item: str) -> list[str] | set[str]: