Merge branch 'master' into fix/cant-pan-after-ui-editor
Project CI / AI game creator shell Rust shard 1/4 (pull_request) Successful in 5m12s
Project CI / AI game creator shell Rust shard 3/4 (pull_request) Successful in 5m18s
Project CI / AI game creator shell Rust shard 2/4 (pull_request) Successful in 5m22s
Project CI / AI game creator shell Rust shard 4/4 (pull_request) Successful in 5m23s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 1m39s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 3m21s
Project CI / Frontend tests (pull_request) Successful in 4m18s
Project CI / AI game creator shell web tests (pull_request) Has started running
Project CI / Native shell tests (pull_request) Successful in 6m7s
Project CI / Repository checks (pull_request) Successful in 3m1s
Project CI / Backend tests (pull_request) Successful in 7m41s
Project CI / AI game creator shell Rust shard 1/4 (pull_request) Successful in 5m12s
Project CI / AI game creator shell Rust shard 3/4 (pull_request) Successful in 5m18s
Project CI / AI game creator shell Rust shard 2/4 (pull_request) Successful in 5m22s
Project CI / AI game creator shell Rust shard 4/4 (pull_request) Successful in 5m23s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 1m39s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 3m21s
Project CI / Frontend tests (pull_request) Successful in 4m18s
Project CI / AI game creator shell web tests (pull_request) Has started running
Project CI / Native shell tests (pull_request) Successful in 6m7s
Project CI / Repository checks (pull_request) Successful in 3m1s
Project CI / Backend tests (pull_request) Successful in 7m41s
This commit is contained in:
+29
-2
@@ -265,11 +265,11 @@ pub fn inspect_separation_recovery(
|
||||
}
|
||||
|
||||
pub fn finalize_separation(root: &Path, asset_id: &str) -> Result<(), String> {
|
||||
remove_separation_state(root, asset_id)
|
||||
remove_separation_recovery_files(root, asset_id)
|
||||
}
|
||||
|
||||
pub fn discard_separation_recovery(root: &Path, asset_id: &str) -> Result<(), String> {
|
||||
remove_separation_state(root, asset_id)
|
||||
remove_separation_recovery_files(root, asset_id)
|
||||
}
|
||||
|
||||
fn remove_separation_state(root: &Path, asset_id: &str) -> Result<(), String> {
|
||||
@@ -281,6 +281,33 @@ fn remove_separation_state(root: &Path, asset_id: &str) -> Result<(), String> {
|
||||
}
|
||||
}
|
||||
|
||||
fn remove_separation_recovery_files(root: &Path, asset_id: &str) -> Result<(), String> {
|
||||
let sidecar = separation_sidecar_dir(root, asset_id)?;
|
||||
remove_separation_state(root, asset_id)?;
|
||||
let entries = match fs::read_dir(&sidecar) {
|
||||
Ok(entries) => entries,
|
||||
Err(error) if error.kind() == std::io::ErrorKind::NotFound => return Ok(()),
|
||||
Err(error) => return Err(format!("读取 separation 临时文件失败:{error}")),
|
||||
};
|
||||
for entry in entries {
|
||||
let entry = entry.map_err(|error| format!("读取 separation 临时文件失败:{error}"))?;
|
||||
let name = entry.file_name();
|
||||
let name = name.to_string_lossy();
|
||||
if name.starts_with("processed-") || name.starts_with("binding-") {
|
||||
let path = entry.path();
|
||||
if entry
|
||||
.file_type()
|
||||
.map_err(|error| format!("检查 separation 临时文件失败:{error}"))?
|
||||
.is_file()
|
||||
{
|
||||
fs::remove_file(&path)
|
||||
.map_err(|error| format!("删除 separation 临时文件失败:{error}"))?;
|
||||
}
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
@@ -1212,7 +1212,15 @@ export function useUiEditorSession(
|
||||
'自动切分素材结果已写入编辑器,但 State 保存失败;sidecar 已保留,可继续恢复。',
|
||||
);
|
||||
}
|
||||
if (backfillErrors.length > 0) {
|
||||
if (
|
||||
backfillErrors.length > 0 ||
|
||||
completedResult.problematic_nodes.length > 0
|
||||
) {
|
||||
if (completedResult.problematic_nodes.length > 0) {
|
||||
backfillErrors.push(
|
||||
`${completedResult.problematic_nodes.length} 个节点达到返工上限,需要人工处理`,
|
||||
);
|
||||
}
|
||||
const recovery = await invoke<SeparationRecoveryDTO>(
|
||||
'inspect_separation_recovery',
|
||||
{ projectPath, assetId: resourceId },
|
||||
|
||||
Reference in New Issue
Block a user