This commit is contained in:
2026-03-21 22:56:37 -07:00
parent b183167a64
commit f8c98b39bd
4 changed files with 304 additions and 82 deletions

View File

@@ -180,6 +180,7 @@ class Add_File(Cmdlet):
arg=[
SharedArgs.PATH,
SharedArgs.STORE,
SharedArgs.URL,
SharedArgs.PROVIDER,
CmdletArg(
name="delete",
@@ -220,6 +221,7 @@ class Add_File(Cmdlet):
path_arg = parsed.get("path")
location = parsed.get("store")
source_url_arg = parsed.get("url")
provider_name = parsed.get("provider")
delete_after = parsed.get("delete", False)
@@ -519,6 +521,29 @@ class Add_File(Cmdlet):
for idx, item in enumerate(items_to_process, 1):
pipe_obj = coerce_to_pipe_object(item, path_arg)
if source_url_arg:
try:
from SYS.metadata import normalize_urls
cli_urls = [u.strip() for u in str(source_url_arg).split(",") if u and u.strip()]
merged_urls: List[str] = []
if isinstance(getattr(pipe_obj, "extra", None), dict):
existing_url = pipe_obj.extra.get("url")
if isinstance(existing_url, list):
merged_urls.extend(str(u) for u in existing_url if u)
elif isinstance(existing_url, str) and existing_url.strip():
merged_urls.append(existing_url.strip())
else:
pipe_obj.extra = {}
merged_urls.extend(cli_urls)
merged_urls = normalize_urls(merged_urls)
if merged_urls:
pipe_obj.extra["url"] = merged_urls
except Exception:
pass
try:
label = pipe_obj.title
if not label and pipe_obj.path: