refactor: type downloader action contracts

This commit is contained in:
jxxghp
2026-08-24 01:11:47 +08:00
parent f37407d0f3
commit 14e70208a2
4 changed files with 107 additions and 30 deletions
+61 -29
View File
@@ -3740,15 +3740,23 @@
"version": 1
},
"download": {
"aggregation": "legacy",
"aggregation": "first_non_empty",
"error_policy": "isolate_provider",
"execution": "sync_or_async",
"family": "downloader",
"input_contract": "DownloaderKeywordArguments",
"input_contract": "DownloadTaskRequest",
"plugin_short_circuit": true,
"public_to_plugins": true,
"required_parameters": [],
"result_contract": "DownloaderProviderResult",
"required_parameters": [
"category",
"content",
"cookie",
"download_dir",
"downloader",
"episodes",
"label"
],
"result_contract": "DownloadTaskResult | None",
"result_shape": "any",
"supports_async": true,
"supports_sync": true,
@@ -5014,16 +5022,20 @@
"version": 1
},
"remove_torrents": {
"aggregation": "legacy",
"aggregation": "first_non_empty",
"error_policy": "isolate_provider",
"execution": "sync_or_async",
"family": "downloader",
"input_contract": "DownloaderKeywordArguments",
"input_contract": "TorrentRemoveRequest",
"plugin_short_circuit": true,
"public_to_plugins": true,
"required_parameters": [],
"result_contract": "DownloaderProviderResult",
"result_shape": "any",
"required_parameters": [
"delete_file",
"downloader",
"hashs"
],
"result_contract": "bool | None",
"result_shape": "boolean",
"supports_async": true,
"supports_sync": true,
"timeout_policy": "caller_budget",
@@ -5228,16 +5240,20 @@
"version": 1
},
"set_torrents_tag": {
"aggregation": "legacy",
"aggregation": "first_non_empty",
"error_policy": "isolate_provider",
"execution": "sync_or_async",
"family": "downloader",
"input_contract": "DownloaderKeywordArguments",
"input_contract": "TorrentTagRequest",
"plugin_short_circuit": true,
"public_to_plugins": true,
"required_parameters": [],
"result_contract": "DownloaderProviderResult",
"result_shape": "any",
"required_parameters": [
"downloader",
"hashs",
"tags"
],
"result_contract": "bool | None",
"result_shape": "boolean",
"supports_async": true,
"supports_sync": true,
"timeout_policy": "caller_budget",
@@ -5282,32 +5298,38 @@
"version": 1
},
"start_torrents": {
"aggregation": "legacy",
"aggregation": "first_non_empty",
"error_policy": "isolate_provider",
"execution": "sync_or_async",
"family": "downloader",
"input_contract": "DownloaderKeywordArguments",
"input_contract": "TorrentControlRequest",
"plugin_short_circuit": true,
"public_to_plugins": true,
"required_parameters": [],
"result_contract": "DownloaderProviderResult",
"result_shape": "any",
"required_parameters": [
"downloader",
"hashs"
],
"result_contract": "bool | None",
"result_shape": "boolean",
"supports_async": true,
"supports_sync": true,
"timeout_policy": "caller_budget",
"version": 1
},
"stop_torrents": {
"aggregation": "legacy",
"aggregation": "first_non_empty",
"error_policy": "isolate_provider",
"execution": "sync_or_async",
"family": "downloader",
"input_contract": "DownloaderKeywordArguments",
"input_contract": "TorrentControlRequest",
"plugin_short_circuit": true,
"public_to_plugins": true,
"required_parameters": [],
"result_contract": "DownloaderProviderResult",
"result_shape": "any",
"required_parameters": [
"downloader",
"hashs"
],
"result_contract": "bool | None",
"result_shape": "boolean",
"supports_async": true,
"supports_sync": true,
"timeout_policy": "caller_budget",
@@ -5784,16 +5806,26 @@
"version": 1
},
"update_torrent": {
"aggregation": "legacy",
"aggregation": "first_non_empty",
"error_policy": "isolate_provider",
"execution": "sync_or_async",
"family": "downloader",
"input_contract": "DownloaderKeywordArguments",
"input_contract": "TorrentUpdateRequest",
"plugin_short_circuit": true,
"public_to_plugins": true,
"required_parameters": [],
"result_contract": "DownloaderProviderResult",
"result_shape": "any",
"required_parameters": [
"category",
"download_limit",
"downloader",
"hash_string",
"ratio_limit",
"save_path",
"seeding_time_limit",
"tracker_list",
"upload_limit"
],
"result_contract": "dict[str, bool] | None",
"result_shape": "mapping",
"supports_async": true,
"supports_sync": true,
"timeout_policy": "caller_budget",