j
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user