refactor(download): remove ProviderCore/download.py, move sanitize_filename to SYS.utils, replace callers to use API.HTTP.HTTPClient
This commit is contained in:
@@ -13,10 +13,11 @@ This document explains the `ResultTable` system used across the CLI and TUI: how
|
||||
|
||||
- **ResultTable** (`SYS/result_table.py`)
|
||||
- Renders rows as a rich table and stores metadata used for selection expansion.
|
||||
- Important APIs: `add_result()`, `set_table()`, `set_source_command()`, `set_row_selection_args()`, `set_table_metadata()`, and `select_interactive()`.
|
||||
- Important APIs: `add_result()`, `set_table()`, `set_source_command()`, `set_row_selection_args()`, `set_row_selection_action()`, `set_table_metadata()`, and `select_interactive()`.
|
||||
|
||||
- **ResultRow**
|
||||
- Holds columns plus `selection_args` (used for `@N` expansion) and `payload` (original object).
|
||||
- Optionally stores `selection_action`, a full list of CLI tokens to run when `@N` selects this row. When present the CLI honors the explicit action instead of reconstructing it from `source_command` and `selection_args`.
|
||||
|
||||
- **Provider selector**
|
||||
- If a provider implements `selector(selected_items, ctx=..., stage_is_last=True)`, it is run first when `@N` is used; if the selector returns `True` it has handled the selection (e.g., drilling into a folder and publishing a new ResultTable).
|
||||
@@ -112,7 +113,7 @@ SearchResult(
|
||||
)
|
||||
```
|
||||
|
||||
Illustrative file SearchResult (after drilling):
|
||||
4. Otherwise, for single selections, CLI checks for `row.selection_action` and runs that verbatim if present; otherwise it expands `source_command + source_args + row_selection_args`. For multi-selections, items are piped downstream.
|
||||
|
||||
```py
|
||||
SearchResult(
|
||||
@@ -217,6 +218,8 @@ Notes:
|
||||
|
||||
---
|
||||
|
||||
For more detail on ResultTable provider authoring, see `docs/provider_authoring.md`.
|
||||
|
||||
If you'd like, I can also:
|
||||
- Add provider-specific examples (AllDebrid, Bandcamp) into this doc ✅
|
||||
- Add a short checklist for PR reviewers when adding new providers
|
||||
|
||||
Reference in New Issue
Block a user