P1-1: 一键生成P1级效果层补齐 - clip级转场/滤镜/片头片尾从模板映射 #468

Merged
auto-approve-bot merged 3 commits from feature/unified-gen-effect-layer-p1 into develop 2026-07-17 13:59:04 +08:00
Owner

变更内容

一键生成模式下,clip级效果层从模板配置自动映射,补齐P1级效果层:转场、滤镜、片头片尾。

修复方案

新增函数

  1. _load_template_clip_configs(template_id) - 从DB读取模板clip配置列表,失败返回空列表不阻断
  2. _apply_template_clip_effects(clips, clip_configs, mode) - 按位置映射clip级效果
    • 转场:transition_effect 字段直接映射
    • 滤镜:clip.config.color_grade 映射
    • 调速/倒放/抠图:clip.config.speed/reverse/chroma_key 映射
    • 素材多于模板配置时复用最后一个配置
  3. _extract_intro_outro_from_clip_configs(clip_configs) - 从intro/outro类型clip提取plan级配置
    • 走UnifiedRenderService已有的 plan.config.intro_outro 路径
    • 支持text/follow类型片头片尾

调用链路

  • _build_plan_and_clips_from_task 增加 template_id 参数
  • 有 template_id 时自动读取模板配置并注入效果层
  • _render_video 传入 template_id

设计原则

  • 失败降级:模板读取失败/无配置时保持原行为,不阻断渲染
  • 最小侵入:只新增函数和参数,不改已有逻辑
  • 向后兼容:不传 template_id 时行为完全不变

测试

  • 8个新增单元测试覆盖:转场映射、滤镜映射、配置保留、空配置、cut不覆盖、intro/outro提取等
## 变更内容 一键生成模式下,clip级效果层从模板配置自动映射,补齐P1级效果层:转场、滤镜、片头片尾。 ## 修复方案 ### 新增函数 1. **`_load_template_clip_configs(template_id)`** - 从DB读取模板clip配置列表,失败返回空列表不阻断 2. **`_apply_template_clip_effects(clips, clip_configs, mode)`** - 按位置映射clip级效果 - 转场:`transition_effect` 字段直接映射 - 滤镜:`clip.config.color_grade` 映射 - 调速/倒放/抠图:`clip.config.speed/reverse/chroma_key` 映射 - 素材多于模板配置时复用最后一个配置 3. **`_extract_intro_outro_from_clip_configs(clip_configs)`** - 从intro/outro类型clip提取plan级配置 - 走UnifiedRenderService已有的 `plan.config.intro_outro` 路径 - 支持text/follow类型片头片尾 ### 调用链路 - `_build_plan_and_clips_from_task` 增加 `template_id` 参数 - 有 template_id 时自动读取模板配置并注入效果层 - `_render_video` 传入 template_id ## 设计原则 - 失败降级:模板读取失败/无配置时保持原行为,不阻断渲染 - 最小侵入:只新增函数和参数,不改已有逻辑 - 向后兼容:不传 template_id 时行为完全不变 ## 测试 - 8个新增单元测试覆盖:转场映射、滤镜映射、配置保留、空配置、cut不覆盖、intro/outro提取等
xiaoxia added 1 commit 2026-07-17 13:17:44 +08:00
P1-1: 一键生成P1级效果层补齐 - clip级转场/滤镜/片头片尾从模板映射
CI Build & Deploy Pipeline / Build Staging API Image (pull_request) Has been skipped
CI Build & Deploy Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI Build & Deploy Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI Build & Deploy Pipeline / Build Production API Image (pull_request) Has been skipped
CI Build & Deploy Pipeline / Build Production Web Image (pull_request) Has been skipped
CI Build & Deploy Pipeline / Build Production Worker Image (pull_request) Has been skipped
CI Build & Deploy Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI Build & Deploy Pipeline / Deploy Production (pull_request) Has been skipped
CI Build & Deploy Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI Build & Deploy Pipeline / Production Browser E2E (pull_request) Has been skipped
CI Build & Deploy Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 22s
AI Code Review / AI Code Review (pull_request) Successful in 2m48s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 1m1s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Failing after 1m1s
Auto Approve CI PRs / Auto Approve on CI Green (pull_request) Successful in 4m18s
Auto Merge CI PRs / Auto Merge on CI Green + Approved (pull_request) Successful in 4m23s
CI/CD Pipeline / Unit Tests (pull_request) Failing after 3m10s
CI/CD Pipeline / Integration Tests (pull_request) Successful in 1m33s
a679c55ae4
- 新增 _load_template_clip_configs() 从模板读取clip配置列表
- 新增 _apply_template_clip_effects() 按位置映射clip级效果(转场/滤镜/调速等)
- 新增 _extract_intro_outro_from_clip_configs() 从intro/outro类型clip提取plan级片头片尾配置
- _build_plan_and_clips_from_task 增加 template_id 参数,自动注入效果层
- 素材多于模板配置时复用最后一个配置,失败降级不阻断
- 配套8个单元测试
xiaoxia added 1 commit 2026-07-17 13:25:13 +08:00
fix: isort导入排序
CI Build & Deploy Pipeline / Build Staging API Image (pull_request) Has been skipped
CI Build & Deploy Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI Build & Deploy Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI Build & Deploy Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI Build & Deploy Pipeline / Build Production API Image (pull_request) Has been skipped
CI Build & Deploy Pipeline / Build Production Web Image (pull_request) Has been skipped
CI Build & Deploy Pipeline / Build Production Worker Image (pull_request) Has been skipped
CI Build & Deploy Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI Build & Deploy Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI Build & Deploy Pipeline / Deploy Production (pull_request) Has been skipped
CI Build & Deploy Pipeline / Production Browser E2E (pull_request) Has been skipped
AI Code Review / AI Code Review (pull_request) Failing after 26s
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 13s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 49s
CI/CD Pipeline / Unit Tests (pull_request) Failing after 3m7s
Auto Approve CI PRs / Auto Approve on CI Green (pull_request) Successful in 5m17s
Auto Merge CI PRs / Auto Merge on CI Green + Approved (pull_request) Successful in 3m34s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Successful in 3m3s
CI/CD Pipeline / Integration Tests (pull_request) Successful in 1m24s
f671dad959
xiaoxia force-pushed feature/unified-gen-effect-layer-p1 from bb66e38321 to f671dad959 2026-07-17 13:25:13 +08:00 Compare
xiaoxia added 1 commit 2026-07-17 13:54:09 +08:00
fix: dataclass字段名遮蔽函数参数导致NameError
CI Build & Deploy Pipeline / Build Staging API Image (pull_request) Has been skipped
CI Build & Deploy Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI Build & Deploy Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI Build & Deploy Pipeline / Build Production API Image (pull_request) Has been skipped
CI Build & Deploy Pipeline / Build Production Web Image (pull_request) Has been skipped
CI Build & Deploy Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI Build & Deploy Pipeline / Build Production Worker Image (pull_request) Has been skipped
CI Build & Deploy Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI Build & Deploy Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI Build & Deploy Pipeline / Deploy Production (pull_request) Has been skipped
CI Build & Deploy Pipeline / Production Browser E2E (pull_request) Has been skipped
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 20s
CI/CD Pipeline / Frontend Lint (pull_request) Successful in 45s
AI Code Review / AI Code Review (pull_request) Successful in 1m16s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Successful in 3m0s
CI/CD Pipeline / Unit Tests (pull_request) Successful in 3m14s
Auto Approve CI PRs / Auto Approve on CI Green (pull_request) Successful in 3m41s
CI/CD Pipeline / Integration Tests (pull_request) Successful in 1m23s
Auto Merge CI PRs / Auto Merge on CI Green + Approved (pull_request) Successful in 4m54s
687a015357
auto-approve-bot approved these changes 2026-07-17 13:57:49 +08:00
auto-approve-bot left a comment
Collaborator

CI全绿,自动审批通过。

CI全绿,自动审批通过。
auto-approve-bot approved these changes 2026-07-17 13:57:49 +08:00
auto-approve-bot left a comment
Collaborator

CI全绿,自动审批通过。

CI全绿,自动审批通过。
auto-approve-bot merged commit b7a0d29b0d into develop 2026-07-17 13:59:04 +08:00
auto-approve-bot deleted branch feature/unified-gen-effect-layer-p1 2026-07-17 13:59:04 +08:00
Sign in to join this conversation.