fix: ensure cover title matches current video title #1520

Merged
xiaoxia merged 1 commits from fix/cover-title-consistency into develop 2026-08-27 14:43:43 +08:00
Owner

问题

封面存储使用 covers/{plan_id}/frame_{i}.jpg,所有任务共用同一个封面文件。用户修改标题后生成新视频,封面可能显示旧标题。

修复

1. thumbnail_generator.py

  • 添加 task_id 参数到 extract_and_upload_cover_frames 函数
  • 将存储 key 从 covers/{plan_id}/frame_{i}.jpg 改为 covers/{plan_id}/{task_id}/frame_{i}.jpg
  • MediaKit 帧同样使用新的路径格式

2. render_adapter.py

  • 传递 job_id 作为 task_id 参数到 extract_and_upload_cover_frames

3. generation_tasks.py

  • _writeback_edit_plan_config 函数中,比较新旧标题
  • 如果标题发生变化,清除 plan.config 中的 cover 字段,强制封面重新生成

验证

生成视频A(标题"测试1")→ 封面显示"测试1"
修改标题为"测试2",生成视频B → 封面显示"测试2"(不是"测试1")
两个视频的封面文件独立存储,互不影响

## 问题 封面存储使用 `covers/{plan_id}/frame_{i}.jpg`,所有任务共用同一个封面文件。用户修改标题后生成新视频,封面可能显示旧标题。 ## 修复 ### 1. thumbnail_generator.py - 添加 `task_id` 参数到 `extract_and_upload_cover_frames` 函数 - 将存储 key 从 `covers/{plan_id}/frame_{i}.jpg` 改为 `covers/{plan_id}/{task_id}/frame_{i}.jpg` - MediaKit 帧同样使用新的路径格式 ### 2. render_adapter.py - 传递 `job_id` 作为 `task_id` 参数到 `extract_and_upload_cover_frames` ### 3. generation_tasks.py - 在 `_writeback_edit_plan_config` 函数中,比较新旧标题 - 如果标题发生变化,清除 `plan.config` 中的 `cover` 字段,强制封面重新生成 ## 验证 生成视频A(标题"测试1")→ 封面显示"测试1" 修改标题为"测试2",生成视频B → 封面显示"测试2"(不是"测试1") 两个视频的封面文件独立存储,互不影响
xiaoxia added 1 commit 2026-08-27 14:30:46 +08:00
fix: ensure cover title matches current video title
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 / 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 2m52s
CI/CD Pipeline / Frontend Lint (pull_request) Has been skipped
CI/CD Pipeline / Frontend Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / PR Build Web Image (pull_request) Has been skipped
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 4m2s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 4m3s
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Successful in 4m5s
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 1m19s
CI/CD Pipeline / Validate - Migration (alembic) (pull_request) Successful in 4m17s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 2m12s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 5m52s
CI/CD Pipeline / Unit Tests (pull_request) Successful in 4m59s
CI/CD Pipeline / Validate - Code Quality (pull_request) Successful in 8m46s
CI/CD Pipeline / Build Production API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Canary Release to Production (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
AI Code Review / AI Code Review (pull_request) Successful in 9m23s
CI/CD Pipeline / Integration Tests (pull_request) Successful in 3m20s
CI/CD Pipeline / CI Gate (pull_request) Successful in 29s
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 3m19s
ACR Cleanup / ACR Image Cleanup (pull_request_target) Successful in 3m31s
98b9e15879
- Add task_id parameter to extract_and_upload_cover_frames
- Change storage key from covers/{plan_id}/frame_{i}.jpg to covers/{plan_id}/{task_id}/frame_{i}.jpg
- Clear cover field in plan.config when title changes in _writeback_edit_plan_config
- Pass job_id as task_id in render_adapter.py

This fixes the issue where modifying the title and generating a new video
would still show the old title on the cover.

🚀 预览环境已部署

项目 详情
PR号 #1520
预览链接 https://pr-1520.preview.xiaoxiajianji.com
API环境 staging

💡 预览环境使用 staging API 数据,请勿在预览环境中操作重要数据。

🔄 每次提交新代码后预览环境会自动更新。

🗑️ PR 关闭或合并后,预览环境会自动清理。

🚀 **预览环境已部署** | 项目 | 详情 | |------|------| | PR号 | #1520 | | 预览链接 | [https://pr-1520.preview.xiaoxiajianji.com](https://pr-1520.preview.xiaoxiajianji.com) | | API环境 | staging | > 💡 预览环境使用 staging API 数据,请勿在预览环境中操作重要数据。 > > 🔄 每次提交新代码后预览环境会自动更新。 > > 🗑️ PR 关闭或合并后,预览环境会自动清理。
auto-approve-bot approved these changes 2026-08-27 14:40:30 +08:00
auto-approve-bot left a comment
Collaborator

CI全绿,自动审批通过。

CI全绿,自动审批通过。
auto-approve-bot approved these changes 2026-08-27 14:40:30 +08:00
auto-approve-bot left a comment
Collaborator

CI全绿,自动审批通过。

CI全绿,自动审批通过。
xiaoxia merged commit 7cdd06802d into develop 2026-08-27 14:43:43 +08:00

🗑️ 预览环境已清理

PR #1520 已关闭或合并,对应的预览环境已被清理。

如有需要,可以重新打开 PR 来重新生成预览环境。

🗑️ **预览环境已清理** PR #1520 已关闭或合并,对应的预览环境已被清理。 > 如有需要,可以重新打开 PR 来重新生成预览环境。
Sign in to join this conversation.