feat: #1767 BGM 池差异化分配,打破变体间音频指纹一致性 (#1785)
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (push) Successful in 3s
CI/CD Pipeline / Dedup Check - skip PR tests when covered by push pipeline (pull_request) Successful in 4s
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 3s
CI/CD Pipeline / Check push changed paths (push) Successful in 9s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 30s
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 51s
CI/CD Pipeline / Integration Tests (push) Successful in 1m45s
CI/CD Pipeline / Build Staging API Image (push) Successful in 34s
CI/CD Pipeline / Validate - Python (mypy + alembic) (push) Successful in 1m49s
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 42s
CI/CD Pipeline / Validate - Style (push) Successful in 2m34s
CI/CD Pipeline / Build Staging Web Image (push) Successful in 1m20s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 55s
CI/CD Pipeline / Validate - Security (push) Has been cancelled
CI/CD Pipeline / Unit Tests (push) Has been cancelled
CI/CD Pipeline / Frontend Unit Tests (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 / Frontend Lint (pull_request) Has been cancelled
CI/CD Pipeline / PR Build Web Image (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
AI Code Review / AI Code Review (pull_request) Has been cancelled
PR Automation / Auto Approve on CI Green (pull_request) Has been cancelled
PR Automation / Auto Merge on CI Green + Approved (pull_request) Has been cancelled
Preview Deploy / Deploy Preview Environment (pull_request) Has been cancelled
CI/CD Pipeline / Retag skipped Staging Worker Image (push) Failing after 197h8m29s
CI/CD Pipeline / Retag skipped Staging API Image (push) Failing after 197h8m30s
CI/CD Pipeline / ACR Image Cleanup (pull_request) Failing after 197h9m19s
CI/CD Pipeline / Staging E2E Tests (pull_request) Failing after 197h9m21s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Failing after 197h9m22s
CI/CD Pipeline / Retag skipped Staging Web Image (pull_request) Failing after 197h10m9s
CI/CD Pipeline / Retag skipped Staging API Image (pull_request) Failing after 197h10m11s
CI/CD Pipeline / Integration Tests (pull_request) Failing after 197h10m35s
CI/CD Pipeline / Unit Tests (pull_request) Failing after 197h10m48s
CI/CD Pipeline / Validate - Python (mypy + alembic) (pull_request) Failing after 197h10m54s
CI/CD Pipeline / Validate - Style (pull_request) Failing after 197h11m4s
CI/CD Pipeline / Frontend Lint (push) Failing after 197h11m9s
CI/CD Pipeline / Build Staging Worker Image (pull_request) Failing after 197h11m11s
CI/CD Pipeline / PR Build Worker Image (push) Failing after 197h11m12s
CI/CD Pipeline / Build Staging Web Image (pull_request) Failing after 197h11m11s
CI/CD Pipeline / PR Build Web Image (push) Failing after 197h11m12s
CI/CD Pipeline / Build Staging API Image (pull_request) Failing after 197h11m11s
CI/CD Pipeline / Check push changed paths (pull_request) Failing after 197h11m13s
CI/CD Pipeline / PR Build API Image (push) Failing after 197h11m13s
CI/CD Pipeline / Check if frontend-only change (push) Failing after 197h11m14s
CI/CD Pipeline / Retag skipped Staging Web Image (push) Failing after 197h43m14s
CI/CD Pipeline / Staging API Integration Tests (pull_request) Failing after 197h44m4s
CI/CD Pipeline / Retag skipped Staging Worker Image (pull_request) Failing after 197h44m50s
CI/CD Pipeline / Frontend Unit Tests (pull_request) Failing after 197h45m17s
CI/CD Pipeline / Validate - Security (pull_request) Failing after 197h45m43s

Co-authored-by: xiaoxia <dev@xiaoxiajianji.com>
Co-committed-by: xiaoxia <dev@xiaoxiajianji.com>
This commit was merged in pull request #1785.
This commit is contained in:
2026-09-08 10:12:52 +08:00
committed by auto-approve-bot
parent 12a9efc65d
commit 98cf571ab3
4 changed files with 650 additions and 5 deletions
+24 -1
View File
@@ -932,6 +932,17 @@ class EditPlanService:
rhythm_templates_for_variants.append(template)
logger.info("变体 %d 节奏模板: plan=%s template=%s", idx, plan_ids[idx], template)
# #1767:BGM 池差异化分配(让批量变体使用不同 BGM / 段落 / 音量)
from packages.domain.bgm_pool import allocate_bgm_pool_for_variants
source_bgm_config = {}
source_plan = self.get_plan(source_plan_id)
if source_plan and source_plan.config:
source_bgm_config = source_plan.config.get("bgm", {}) or {}
variant_seeds_for_bgm = [rng.randint(0, 999999) for _ in plan_ids]
bgm_pool_assignments = allocate_bgm_pool_for_variants(source_bgm_config, variant_seeds_for_bgm)
# 为每个变体生成独立视觉扰动参数(让批量视频画面本身更不同)
from packages.domain.variant_plan_selector import generate_visual_perturbation
@@ -950,8 +961,20 @@ class EditPlanService:
pixel_pert = generate_pixel_perturbation(rng)
config_update["pixel_perturbation"] = pixel_pert
# #1767:写入 BGM 池分配(覆盖 bgm 配置中的 preset_id / audio_offset / volume_adjust_db)
if idx < len(bgm_pool_assignments):
existing_bgm = dict((source_plan.config or {}).get("bgm", {}) or {})
existing_bgm.update(bgm_pool_assignments[idx])
config_update["bgm"] = existing_bgm
self.update_plan_config(pid, config_update)
logger.info("变体 %d 视觉扰动+像素扰动: plan=%s vis=%s pix=%s", idx, pid, perturbation, pixel_pert)
logger.info(
"变体 %d 视觉扰动+像素扰动+BGM池: plan=%s vis=%s pix=%s bgm=%s",
idx,
pid,
perturbation,
pixel_pert,
bgm_pool_assignments[idx] if idx < len(bgm_pool_assignments) else None,
)
except Exception:
logger.exception("变体 %d 视觉扰动生成失败(不阻断): plan=%s", idx, pid)