d
This commit is contained in:
@@ -432,13 +432,7 @@ class Download_File(Cmdlet):
|
||||
pass
|
||||
|
||||
transfer_label = label
|
||||
table_type = str(table or "").lower()
|
||||
if table_type == "tidal" or table_type.startswith("tidal."):
|
||||
try:
|
||||
progress.begin_transfer(label=transfer_label, total=None)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
|
||||
# If this looks like a provider item and providers are available, prefer provider.download()
|
||||
downloaded_path: Optional[Path] = None
|
||||
attempted_provider_download = False
|
||||
@@ -448,9 +442,16 @@ class Download_File(Cmdlet):
|
||||
if provider_key and get_search_provider and SearchResult:
|
||||
# Reuse helper to derive the provider key from table/provider/source hints.
|
||||
provider_obj = get_search_provider(provider_key, config)
|
||||
if provider_obj is not None:
|
||||
attempted_provider_download = True
|
||||
sr = SearchResult(
|
||||
|
||||
if provider_obj is not None and getattr(provider_obj, "prefers_transfer_progress", False):
|
||||
try:
|
||||
progress.begin_transfer(label=transfer_label, total=None)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
if provider_obj is not None:
|
||||
attempted_provider_download = True
|
||||
sr = SearchResult(
|
||||
table=str(table),
|
||||
title=str(title or "Unknown"),
|
||||
path=str(target or ""),
|
||||
@@ -563,8 +564,7 @@ class Download_File(Cmdlet):
|
||||
except Exception as e:
|
||||
log(f"Error downloading item: {e}", file=sys.stderr)
|
||||
finally:
|
||||
table_type = str(table or "").lower()
|
||||
if table_type == "tidal" or table_type.startswith("tidal."):
|
||||
if provider_obj is not None and getattr(provider_obj, "prefers_transfer_progress", False):
|
||||
try:
|
||||
progress.finish_transfer(label=transfer_label)
|
||||
except Exception:
|
||||
|
||||
Reference in New Issue
Block a user