From b141736213f1e7d675f5e094670f815eae0ed32e Mon Sep 17 00:00:00 2001 From: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com> Date: Mon, 15 Sep 2025 15:36:40 -0700 Subject: [PATCH] fix: sanitize json tag input as strings --- src/tagstudio/core/macro_parser.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tagstudio/core/macro_parser.py b/src/tagstudio/core/macro_parser.py index fc85c343..f2d5b748 100644 --- a/src/tagstudio/core/macro_parser.py +++ b/src/tagstudio/core/macro_parser.py @@ -356,8 +356,12 @@ def _import_data(table: dict[str, Any], table_key: str, filepath: Path) -> list[ else: # If no delimiter is provided, assume the string is a single tag tag_strings.append(content_value) + elif isinstance(content_value, bool): + tag_strings = [str(content_value)] + elif isinstance(content_value, list): + tag_strings = [str(v) for v in content_value] # pyright: ignore[reportUnknownVariableType] else: - tag_strings = deepcopy(content_value) + tag_strings = deepcopy([content_value]) # Remove a prefix (if given) from all tags strings (if any) prefix = str(obj.get(PREFIX, ""))