mirror of
https://github.com/Yuyi-Oak/BlueArchiveToolkit.git
synced 2026-09-18 08:14:55 +08:00
@@ -156,6 +156,35 @@ pub(super) fn run_translation_set(options: &CliOptions) -> anyhow::Result<()> {
|
||||
)
|
||||
}
|
||||
|
||||
pub(super) fn run_translation_task_update(options: &CliOptions) -> anyhow::Result<()> {
|
||||
let task_id = options
|
||||
.query_task_id
|
||||
.as_deref()
|
||||
.ok_or_else(|| anyhow::anyhow!("i18n task update 必须指定 --task-id"))?;
|
||||
let status = options
|
||||
.query_task_status
|
||||
.as_deref()
|
||||
.ok_or_else(|| anyhow::anyhow!("i18n task update 必须指定 --task-status"))?;
|
||||
let mut params = serde_json::Map::from_iter([
|
||||
("task_id".to_string(), serde_json::json!(task_id)),
|
||||
("status".to_string(), serde_json::json!(status)),
|
||||
]);
|
||||
if let Some(reason) = options.translation_failure_reason.as_deref() {
|
||||
params.insert("failure_reason".to_string(), serde_json::json!(reason));
|
||||
}
|
||||
if let Some(provider_run_id) = options.translation_provider_run_id.as_deref() {
|
||||
params.insert(
|
||||
"provider_run_id".to_string(),
|
||||
serde_json::json!(provider_run_id),
|
||||
);
|
||||
}
|
||||
let report = update_translation_task_status_report(
|
||||
&options.state_dir,
|
||||
Some(&serde_json::Value::Object(params)),
|
||||
)?;
|
||||
print_json_value(options.output_format, &report)
|
||||
}
|
||||
|
||||
pub(super) fn run_repack(options: &CliOptions) -> anyhow::Result<()> {
|
||||
let spec = options
|
||||
.repack_spec
|
||||
|
||||
Reference in New Issue
Block a user