修复素材画布提交后的生成投影
允许已提交草稿完成最终生成记录投影
This commit is contained in:
@@ -821,6 +821,25 @@ fn validate_generation_draft_active(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn validate_generation_draft_for_public_phase(
|
||||
ledger: &AssetCanvasGenerationLedger,
|
||||
draft: &AssetCanvasDraft,
|
||||
) -> Result<(), String> {
|
||||
if ledger.phase == GenerationLedgerPhase::AssetDurableCommitted
|
||||
&& draft.status == AssetCanvasDraftStatus::Committed
|
||||
{
|
||||
if draft.project_id != ledger.project_id
|
||||
|| draft.draft_id != ledger.draft_id
|
||||
|| draft.intent != ledger.intent
|
||||
|| draft.source_asset_id != ledger.source_asset_id
|
||||
{
|
||||
return Err("素材画布生成账本与草稿身份不一致".to_string());
|
||||
}
|
||||
return Ok(());
|
||||
}
|
||||
validate_generation_draft_active(ledger, draft)
|
||||
}
|
||||
|
||||
fn ensure_generation_draft_active(
|
||||
root: &Path,
|
||||
ledger: &AssetCanvasGenerationLedger,
|
||||
@@ -840,7 +859,7 @@ fn upsert_public_generation_record(
|
||||
let _lock = acquire_asset_canvas_draft_lock(root)?;
|
||||
let mut draft = read_asset_canvas_draft_locked(root, &ledger.project_id, &ledger.draft_id)?
|
||||
.ok_or_else(|| "素材画布草稿不存在".to_string())?;
|
||||
validate_generation_draft_active(ledger, &draft)?;
|
||||
validate_generation_draft_for_public_phase(ledger, &draft)?;
|
||||
let now = asset_canvas_now();
|
||||
let output_asset_id = ledger
|
||||
.commit_result
|
||||
|
||||
Reference in New Issue
Block a user