This commit is contained in:
2026-01-01 20:37:27 -08:00
parent f3c79609d8
commit deb05c0d44
35 changed files with 5030 additions and 4879 deletions

View File

@@ -540,9 +540,11 @@ class Add_Tag(Cmdlet):
)
return 1
hash_override = normalize_hash(query_hash) if query_hash else None
# If add-tag is in the middle of a pipeline (has downstream stages), default to
# including temp files. This enables common flows like:
# @N | download-media | add-tag ... | add-file ...
# @N | download-file | add-tag ... | add-file ...
store_override = parsed.get("store")
stage_ctx = ctx.get_stage_context()
has_downstream = bool(
@@ -562,6 +564,10 @@ class Add_Tag(Cmdlet):
if not include_temp:
results = filter_results_by_temp(results, include_temp=False)
# When no pipeline payload is present but -query/-store pinpoints a hash, tag it directly.
if not results and hash_override and store_override:
results = [{"hash": hash_override, "store": store_override}]
if not results:
log(
"No valid files to tag (all results were temporary; use --all to include temporary files)",
@@ -628,7 +634,6 @@ class Add_Tag(Cmdlet):
return 1
# Get other flags
hash_override = normalize_hash(query_hash) if query_hash else None
duplicate_arg = parsed.get("duplicate")
# tag ARE provided - apply them to each store-backed result