This commit is contained in:
2026-02-08 01:35:44 -08:00
parent 60c2cc062c
commit d2e571b6f1
5 changed files with 160 additions and 9 deletions

View File

@@ -816,6 +816,12 @@ class Add_Tag(Cmdlet):
if new_tag.lower() not in existing_lower:
item_tag_to_add.append(new_tag)
item_tag_to_add = collapse_namespace_tag(
item_tag_to_add,
"title",
prefer="last"
)
removed_namespace_tag: list[str] = []
for new_tag in item_tag_to_add:
if not isinstance(new_tag, str) or ":" not in new_tag:
@@ -844,6 +850,12 @@ class Add_Tag(Cmdlet):
]
updated_tag_list.extend(actual_tag_to_add)
updated_tag_list = collapse_namespace_tag(
updated_tag_list,
"title",
prefer="last"
)
_set_item_tags(res, updated_tag_list)
final_title = _extract_title_tag(updated_tag_list)
_apply_title_to_result(res, final_title)
@@ -981,6 +993,28 @@ class Add_Tag(Cmdlet):
if new_tag.lower() not in existing_lower:
item_tag_to_add.append(new_tag)
item_tag_to_add = collapse_namespace_tag(
item_tag_to_add,
"title",
prefer="last"
)
if not any(
isinstance(t, str) and t.strip().lower().startswith("title:")
for t in item_tag_to_add
):
existing_title_tags = [
t for t in existing_tag_list
if isinstance(t, str) and t.strip().lower().startswith("title:")
]
if len(existing_title_tags) > 1:
item_tag_to_add.append(existing_title_tags[-1])
item_tag_to_add = collapse_namespace_tag(
item_tag_to_add,
"title",
prefer="last"
)
changed = False
refreshed_list = list(existing_tag_list)
try:

View File

@@ -155,7 +155,7 @@ class search_file(Cmdlet):
)
# Ensure we have ext field
if "ext" not in payload:
if ("ext" not in payload) or (not str(payload.get("ext") or "").strip()):
title = str(payload.get("title", ""))
path_obj = Path(title)
if path_obj.suffix: