fix(ai-avatar): 修复B-roll文案时长全为0.0s的问题 (#1871)
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (push) Successful in 1s
CI/CD Pipeline / Check push changed paths (push) Successful in 4s
CI/CD Pipeline / Build Staging Web Image (push) Successful in 23s
CI/CD Pipeline / Build Staging API Image (push) Successful in 24s
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 24s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 59s
CI/CD Pipeline / ACR Image Cleanup (push) Successful in 1m35s
CI/CD Pipeline / Integration Tests (push) Successful in 3m26s
CI/CD Pipeline / Validate - Python (mypy + alembic) (push) Successful in 3m28s
CI/CD Pipeline / Validate - Style (push) Successful in 3m51s
CI/CD Pipeline / Frontend Unit Tests (push) Successful in 4m42s
CI/CD Pipeline / Staging API Integration Tests (push) Successful in 3m28s
CI/CD Pipeline / Staging E2E Tests (push) Failing after 3m49s
CI/CD Pipeline / Validate - Security (push) Successful in 8m11s
CI/CD Pipeline / Unit Tests (push) Successful in 8m48s
CI/CD Pipeline / Production Browser E2E (push) Has been skipped
CI/CD Pipeline / Deploy Production (push) Failing after 96h13m57s
CI/CD Pipeline / Retag skipped Staging API Image (push) Failing after 96h22m23s
CI/CD Pipeline / PR Build API Image (push) Failing after 96h22m49s
CI/CD Pipeline / PR Build Worker Image (push) Failing after 96h22m28s
CI/CD Pipeline / Retag skipped Staging Worker Image (push) Failing after 96h21m58s
CI/CD Pipeline / CI Gate (push) Failing after 96h13m40s
CI/CD Pipeline / Build Production Web Image (push) Failing after 96h13m40s
CI/CD Pipeline / Retag skipped Staging Web Image (push) Failing after 96h21m58s
CI/CD Pipeline / PR Build Web Image (push) Failing after 96h22m29s
CI/CD Pipeline / Canary Release to Production (push) Failing after 96h13m36s
CI/CD Pipeline / Build Production Worker Image (push) Failing after 96h13m40s
CI/CD Pipeline / Frontend Lint (push) Failing after 96h22m30s
CI/CD Pipeline / Check if frontend-only change (push) Failing after 96h22m33s
CI/CD Pipeline / Build Production API Image (push) Failing after 96h48m55s
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (push) Successful in 1s
CI/CD Pipeline / Check push changed paths (push) Successful in 4s
CI/CD Pipeline / Build Staging Web Image (push) Successful in 23s
CI/CD Pipeline / Build Staging API Image (push) Successful in 24s
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 24s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 59s
CI/CD Pipeline / ACR Image Cleanup (push) Successful in 1m35s
CI/CD Pipeline / Integration Tests (push) Successful in 3m26s
CI/CD Pipeline / Validate - Python (mypy + alembic) (push) Successful in 3m28s
CI/CD Pipeline / Validate - Style (push) Successful in 3m51s
CI/CD Pipeline / Frontend Unit Tests (push) Successful in 4m42s
CI/CD Pipeline / Staging API Integration Tests (push) Successful in 3m28s
CI/CD Pipeline / Staging E2E Tests (push) Failing after 3m49s
CI/CD Pipeline / Validate - Security (push) Successful in 8m11s
CI/CD Pipeline / Unit Tests (push) Successful in 8m48s
CI/CD Pipeline / Production Browser E2E (push) Has been skipped
CI/CD Pipeline / Deploy Production (push) Failing after 96h13m57s
CI/CD Pipeline / Retag skipped Staging API Image (push) Failing after 96h22m23s
CI/CD Pipeline / PR Build API Image (push) Failing after 96h22m49s
CI/CD Pipeline / PR Build Worker Image (push) Failing after 96h22m28s
CI/CD Pipeline / Retag skipped Staging Worker Image (push) Failing after 96h21m58s
CI/CD Pipeline / CI Gate (push) Failing after 96h13m40s
CI/CD Pipeline / Build Production Web Image (push) Failing after 96h13m40s
CI/CD Pipeline / Retag skipped Staging Web Image (push) Failing after 96h21m58s
CI/CD Pipeline / PR Build Web Image (push) Failing after 96h22m29s
CI/CD Pipeline / Canary Release to Production (push) Failing after 96h13m36s
CI/CD Pipeline / Build Production Worker Image (push) Failing after 96h13m40s
CI/CD Pipeline / Frontend Lint (push) Failing after 96h22m30s
CI/CD Pipeline / Check if frontend-only change (push) Failing after 96h22m33s
CI/CD Pipeline / Build Production API Image (push) Failing after 96h48m55s
Co-authored-by: frontend-dev <frontend-dev@xiaoxiajianji.com> Co-committed-by: frontend-dev <frontend-dev@xiaoxiajianji.com>
This commit was merged in pull request #1871.
This commit is contained in:
@@ -42,9 +42,10 @@ export function splitScriptIntoSentences(
|
||||
let accChar = 0
|
||||
const totalChars = rawParts.reduce((sum, p) => sum + p.replace(/\s/g, "").length, 0)
|
||||
// 如果后端返回了完整的时间戳(至少有一个有效结束时间),使用精确时间
|
||||
// 需要满足:数组长度与分句数一致,且至少有一个结束时间 > 0(防御全0的异常数据)
|
||||
const hasBackendTimings =
|
||||
sentenceTimings &&
|
||||
sentenceTimings.length > 0 &&
|
||||
sentenceTimings.length >= rawParts.length &&
|
||||
sentenceTimings.some((t) => (t.end_time ?? 0) > 0)
|
||||
|
||||
// 若有后端时间戳,取音频总时长;否则用外部传入的 outputDuration 做字数比例降级
|
||||
|
||||
Reference in New Issue
Block a user