Compare commits

..

3 Commits

Author SHA1 Message Date
xiaoxia 318cffd35c fix(smart-match): limit 算法取 segments.length 下限,保证每片段至少 1 个素材
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 2s
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 3s
AI Code Review / AI Code Review (pull_request) Successful in 4m33s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 4m57s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Successful in 3m26s
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Successful in 5m24s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 5m1s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 5m45s
CI/CD Pipeline / Validate - Style (pull_request) Successful in 6m2s
CI/CD Pipeline / PR Build Web Image (pull_request) Successful in 1m57s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 6m40s
CI/CD Pipeline / Validate - Security (pull_request) Successful in 9m42s
CI/CD Pipeline / CI Gate (pull_request) Successful in 0s
ACR Cleanup / ACR Image Cleanup (pull_request_target) Successful in 2m56s
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 4m28s
CI/CD Pipeline / Production Browser E2E (pull_request) Failing after 363h3m36s
CI/CD Pipeline / Deploy Production (pull_request) Failing after 363h3m37s
CI/CD Pipeline / Build Production Worker Image (pull_request) Failing after 363h3m38s
CI/CD Pipeline / Build Production API Image (pull_request) Failing after 363h3m38s
CI/CD Pipeline / ACR Image Cleanup (pull_request) Failing after 363h8m24s
CI/CD Pipeline / Staging API Integration Tests (pull_request) Failing after 363h8m26s
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Failing after 363h8m43s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 363h8m26s
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Failing after 363h8m43s
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Failing after 363h8m45s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 363h13m22s
CI/CD Pipeline / PR Build Worker Image (pull_request) Failing after 363h8m45s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 363h13m23s
CI/CD Pipeline / PR Build API Image (pull_request) Failing after 363h8m51s
CI/CD Pipeline / Integration Tests (pull_request) Failing after 363h12m44s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 363h13m24s
CI/CD Pipeline / Check push changed paths (pull_request) Failing after 363h13m26s
CI/CD Pipeline / Canary Release to Production (pull_request) Failing after 363h37m53s
CI/CD Pipeline / Build Production Web Image (pull_request) Failing after 363h37m54s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 363h42m44s
CI/CD Pipeline / Unit Tests (pull_request) Failing after 363h47m2s
computeLimitFromSegments 原逻辑 Math.ceil(totalSeconds/15) 在短模板
(如 14s 模板 4 片段)下仅返回 1,导致后端只分配 1 个素材无法覆盖
全部片段。改为 Math.max(segments.length, ...) 保证每个片段至少能
分到 1 个素材。
2026-09-01 12:11:36 +08:00
xiaoxia ff40a7b5f3 feat(title): 预览画面标题自由拖拽——position=custom+PlayRes坐标提交(工单#1405方案B) (#1593)
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (push) Successful in 0s
CI/CD Pipeline / Check push changed paths (push) Successful in 4s
CI/CD Pipeline / Build Staging API Image (push) Successful in 3m51s
CI/CD Pipeline / Build Staging Web Image (push) Successful in 4m35s
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 4m48s
CI/CD Pipeline / Validate - Style (push) Successful in 5m42s
CI/CD Pipeline / Validate - Python (mypy + alembic) (push) Successful in 5m44s
CI/CD Pipeline / Integration Tests (push) Successful in 5m53s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 1m51s
CI/CD Pipeline / Validate - Security (push) Successful in 8m2s
CI/CD Pipeline / Frontend Unit Tests (push) Successful in 9m7s
CI/CD Pipeline / ACR Image Cleanup (push) Successful in 5m14s
CI/CD Pipeline / Staging API Integration Tests (push) Successful in 5m14s
CI/CD Pipeline / Staging E2E Tests (push) Successful in 9m1s
CI/CD Pipeline / Unit Tests (push) Successful in 16m15s
CI/CD Pipeline / Production Browser E2E (push) Failing after 363h4m29s
CI/CD Pipeline / Deploy Production (push) Failing after 363h4m29s
CI/CD Pipeline / CI Gate (push) Failing after 363h4m30s
CI/CD Pipeline / Build Production Web Image (push) Failing after 363h4m30s
CI/CD Pipeline / Build Production API Image (push) Failing after 363h4m30s
CI/CD Pipeline / Retag skipped Staging Worker Image (push) Failing after 363h15m52s
CI/CD Pipeline / Retag skipped Staging Web Image (push) Failing after 363h15m52s
CI/CD Pipeline / Retag skipped Staging API Image (push) Failing after 363h15m52s
CI/CD Pipeline / PR Build Worker Image (push) Failing after 363h20m44s
CI/CD Pipeline / PR Build API Image (push) Failing after 363h20m46s
CI/CD Pipeline / Frontend Lint (push) Failing after 363h20m46s
CI/CD Pipeline / Check if frontend-only change (push) Failing after 363h20m50s
CI/CD Pipeline / Canary Release to Production (push) Failing after 363h38m45s
CI/CD Pipeline / Build Production Worker Image (push) Failing after 363h38m46s
CI/CD Pipeline / PR Build Web Image (push) Failing after 363h55m2s
2026-09-01 12:04:22 +08:00
xiaoxia 6ea77725a5 fix(clips): P0 自建模板 from-assets 400 直接查 clip_configs 表兜底 (#1596)
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (push) Successful in 3s
CI/CD Pipeline / Check push changed paths (push) Successful in 7s
CI/CD Pipeline / Validate - Style (push) Has been cancelled
CI/CD Pipeline / Validate - Security (push) Has been cancelled
CI/CD Pipeline / Validate - Python (mypy + alembic) (push) Has been cancelled
CI/CD Pipeline / Unit Tests (push) Has been cancelled
CI/CD Pipeline / Integration Tests (push) Has been cancelled
CI/CD Pipeline / Frontend Unit Tests (push) Has been cancelled
CI/CD Pipeline / Build Staging API Image (push) Has been cancelled
CI/CD Pipeline / Build Staging Worker Image (push) Has been cancelled
CI/CD Pipeline / Retag skipped Staging API Image (push) Has been cancelled
CI/CD Pipeline / Retag skipped Staging Web Image (push) Has been cancelled
CI/CD Pipeline / Retag skipped Staging Worker Image (push) Has been cancelled
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Has been cancelled
CI/CD Pipeline / Staging E2E Tests (push) Has been cancelled
CI/CD Pipeline / Staging API Integration Tests (push) Has been cancelled
CI/CD Pipeline / Build Production API Image (push) Has been cancelled
CI/CD Pipeline / Build Production Web Image (push) Has been cancelled
CI/CD Pipeline / Build Production Worker Image (push) Has been cancelled
CI/CD Pipeline / Deploy Production (push) Has been cancelled
CI/CD Pipeline / Production Browser E2E (push) Has been cancelled
CI/CD Pipeline / ACR Image Cleanup (push) Has been cancelled
CI/CD Pipeline / Canary Release to Production (push) Has been cancelled
CI/CD Pipeline / CI Gate (push) Has been cancelled
CI/CD Pipeline / Build Staging Web Image (push) Failing after 363h21m23s
CI/CD Pipeline / PR Build Web Image (push) Failing after 363h22m11s
CI/CD Pipeline / Frontend Lint (push) Failing after 363h22m5s
CI/CD Pipeline / PR Build API Image (push) Failing after 363h22m11s
CI/CD Pipeline / Check if frontend-only change (push) Failing after 363h22m13s
CI/CD Pipeline / PR Build Worker Image (push) Failing after 363h56m27s
2026-09-01 12:03:00 +08:00
@@ -20,13 +20,14 @@ const SECONDS_PER_ASSET = 15
/**
* 根据模板 segments 计算所需素材数量上限。
* 取每个 segment 的 duration_min 之和作为目标视频总时长,
* 再按 15 秒/素材估算需要多少个素材;结果钳制到 [1, 200] 区间(后端 limit 上限 200)。
* 再按 15 秒/素材估算需要多少个素材,且保证不少于片段数(每个片段至少 1 个素材);
* 结果钳制到 [1, 200] 区间(后端 limit 上限 200)。
*/
function computeLimitFromSegments(segments?: TemplateSegment[]): number {
if (!segments || segments.length === 0) return DEFAULT_LIMIT
const totalSeconds = segments.reduce((sum, seg) => sum + (seg.duration_min || 0), 0)
if (totalSeconds <= 0) return DEFAULT_LIMIT
const limit = Math.ceil(totalSeconds / SECONDS_PER_ASSET)
const limit = Math.max(segments.length, Math.ceil(totalSeconds / SECONDS_PER_ASSET))
return Math.max(1, Math.min(limit, 200))
}