fix(editing): duration_min 加 Math.max(1, ...) 兜底(AI Review 建议)
CI/CD Pipeline / Check push changed paths (pull_request) Has been skipped
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 3s
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 2m54s
CI/CD Pipeline / Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / PR Build API Image (pull_request) Has been skipped
CI/CD Pipeline / PR Build Worker Image (pull_request) Has been skipped
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 3m48s
CI/CD Pipeline / Validate - Migration (alembic) (pull_request) Successful in 3m44s
AI Code Review / AI Code Review (pull_request) Failing after 4m0s
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Successful in 4m58s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Successful in 2m12s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 5m7s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 5m24s
CI/CD Pipeline / PR Build Web Image (pull_request) Successful in 2m27s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 2m52s
CI/CD Pipeline / Validate - Code Quality (pull_request) Has been cancelled
CI/CD Pipeline / Integration Tests (pull_request) Has been cancelled
CI/CD Pipeline / Build Production API Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Web Image (pull_request) Has been cancelled
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been cancelled
CI/CD Pipeline / Deploy Production (pull_request) Has been cancelled
CI/CD Pipeline / Production Browser E2E (pull_request) Has been cancelled
CI/CD Pipeline / Canary Release to Production (pull_request) Has been cancelled
CI/CD Pipeline / CI Gate (pull_request) Has been cancelled

duration_max 保持 c.duration 不变;duration_min 加最小值保护,
防止 c.duration 为 0 时写入非法值。正常 clip duration > 0 时两者相等。
This commit is contained in:
xiaoxia
2026-08-31 14:35:03 +08:00
parent c8ef7ab262
commit c6dea03367
@@ -98,7 +98,7 @@ export function useTemplateSave(options: UseTemplateSaveOptions) {
estimated_duration: totalDuration,
segments: clips.map((c, i) => ({
segment_order: i,
duration_min: c.duration,
duration_min: Math.max(1, c.duration),
duration_max: c.duration,
material_type: c.type === "voice" ? "voiceover" : "video",
transition: c.transition