mirror of
https://github.com/Yuyi-Oak/BlueArchiveToolkit.git
synced 2026-09-18 06:34:54 +08:00
fix(sync): 对齐 localized 状态契约
This commit is contained in:
@@ -3055,7 +3055,7 @@ fn build_localized_status_report(
|
||||
let state_path = localized_root.join(LOCALIZED_VERSION_STATE_FILE);
|
||||
let current_path = localized_root.join(LOCALIZED_CURRENT_LINK);
|
||||
let state = read_localized_version_state(&localized_root)?;
|
||||
let mut status = "not_localized";
|
||||
let mut localized_release_status = "not_localized";
|
||||
let mut published_version_path = None;
|
||||
let mut matches_current_official_release = false;
|
||||
let mut current_points_to_published_version = false;
|
||||
@@ -3099,14 +3099,14 @@ fn build_localized_status_report(
|
||||
&& current_points_to_published_version
|
||||
&& patch_manifest_matches_release
|
||||
{
|
||||
status = "localized";
|
||||
localized_release_status = "localized";
|
||||
flow_status_code = ReleaseFlowStatusCode::LocalizedPublished;
|
||||
published_version_path = Some(candidate);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
let (_, status_code, status_phase, status_terminal, status_retryable) =
|
||||
let (status, status_code, status_phase, status_terminal, status_retryable) =
|
||||
flow_status_fields(flow_status_code);
|
||||
|
||||
Ok(serde_json::json!({
|
||||
@@ -3116,6 +3116,7 @@ fn build_localized_status_report(
|
||||
"status_phase": status_phase,
|
||||
"status_terminal": status_terminal,
|
||||
"status_retryable": status_retryable,
|
||||
"localized_release_status": localized_release_status,
|
||||
"official_current_version_id": official_version_id,
|
||||
"localized_output_root": localized_root,
|
||||
"state_path": state_path,
|
||||
@@ -10913,8 +10914,9 @@ mod tests {
|
||||
let value = serde_json::to_value(&envelope).unwrap();
|
||||
assert_eq!(value["ok"], true);
|
||||
assert_eq!(value["data"]["available"], true);
|
||||
assert_eq!(value["data"]["status"], "localized");
|
||||
assert_eq!(value["data"]["status"], "published");
|
||||
assert_eq!(value["data"]["status_code"], "localized.published");
|
||||
assert_eq!(value["data"]["localized_release_status"], "localized");
|
||||
assert_eq!(value["data"]["official_current_version_id"], "v-current");
|
||||
assert_eq!(value["data"]["matches_current_official_release"], true);
|
||||
assert_eq!(value["data"]["current_points_to_published_version"], true);
|
||||
@@ -10972,8 +10974,9 @@ mod tests {
|
||||
let value = serde_json::to_value(&envelope).unwrap();
|
||||
assert_eq!(value["ok"], true);
|
||||
assert_eq!(value["data"]["available"], true);
|
||||
assert_eq!(value["data"]["status"], "not_localized");
|
||||
assert_eq!(value["data"]["status"], "stale");
|
||||
assert_eq!(value["data"]["status_code"], "localized.stale");
|
||||
assert_eq!(value["data"]["localized_release_status"], "not_localized");
|
||||
assert_eq!(value["data"]["matches_current_official_release"], false);
|
||||
assert_eq!(
|
||||
value["data"]["published_version_path"],
|
||||
|
||||
Reference in New Issue
Block a user