fix(cover): use bare public URL for video since OSS uploads/* public read is enabled
CI/CD Pipeline / Check if frontend-only change (push) Has been skipped
CI/CD Pipeline / Frontend Lint (push) Has been skipped
CI/CD Pipeline / PR Build API Image (push) Has been skipped
CI/CD Pipeline / PR Build Web Image (push) Has been skipped
CI/CD Pipeline / PR Build Worker Image (push) Has been skipped
CI/CD Pipeline / Validate - Migration (alembic) (push) Successful in 2m7s
CI/CD Pipeline / Validate - Type Check (mypy) (push) Successful in 2m49s
CI/CD Pipeline / Frontend Unit Tests (push) Successful in 3m19s
CI/CD Pipeline / Build Staging Web Image (push) Successful in 3m44s
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 4m40s
CI/CD Pipeline / Validate - Code Quality (push) Successful in 8m41s
CI/CD Pipeline / Unit Tests (push) Successful in 10m21s
CI/CD Pipeline / Build Production Web Image (push) Has been skipped
CI/CD Pipeline / Build Production API Image (push) Has been skipped
CI/CD Pipeline / Build Production Worker Image (push) Has been skipped
CI/CD Pipeline / Deploy Production (push) Has been skipped
CI/CD Pipeline / Production Browser E2E (push) Has been skipped
CI/CD Pipeline / Build Staging API Image (push) Successful in 12m31s
CI/CD Pipeline / Integration Tests (push) Successful in 4m25s
CI/CD Pipeline / CI Gate (push) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 1m25s
CI/CD Pipeline / ACR Image Cleanup (push) Successful in 41s
CI/CD Pipeline / Staging E2E Tests (push) Successful in 47s
CI/CD Pipeline / Staging API Integration Tests (push) Successful in 2m51s
CI/CD Pipeline / Canary Release to Production (push) Has been skipped
CI/CD Pipeline / Check if frontend-only change (push) Has been skipped
CI/CD Pipeline / Frontend Lint (push) Has been skipped
CI/CD Pipeline / PR Build API Image (push) Has been skipped
CI/CD Pipeline / PR Build Web Image (push) Has been skipped
CI/CD Pipeline / PR Build Worker Image (push) Has been skipped
CI/CD Pipeline / Validate - Migration (alembic) (push) Successful in 2m7s
CI/CD Pipeline / Validate - Type Check (mypy) (push) Successful in 2m49s
CI/CD Pipeline / Frontend Unit Tests (push) Successful in 3m19s
CI/CD Pipeline / Build Staging Web Image (push) Successful in 3m44s
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 4m40s
CI/CD Pipeline / Validate - Code Quality (push) Successful in 8m41s
CI/CD Pipeline / Unit Tests (push) Successful in 10m21s
CI/CD Pipeline / Build Production Web Image (push) Has been skipped
CI/CD Pipeline / Build Production API Image (push) Has been skipped
CI/CD Pipeline / Build Production Worker Image (push) Has been skipped
CI/CD Pipeline / Deploy Production (push) Has been skipped
CI/CD Pipeline / Production Browser E2E (push) Has been skipped
CI/CD Pipeline / Build Staging API Image (push) Successful in 12m31s
CI/CD Pipeline / Integration Tests (push) Successful in 4m25s
CI/CD Pipeline / CI Gate (push) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 1m25s
CI/CD Pipeline / ACR Image Cleanup (push) Successful in 41s
CI/CD Pipeline / Staging E2E Tests (push) Successful in 47s
CI/CD Pipeline / Staging API Integration Tests (push) Successful in 2m51s
CI/CD Pipeline / Canary Release to Production (push) Has been skipped
- Changed get_download_url(expires_seconds=3600) to get_url() in cover.py - OSS Bucket Policy now allows anonymous reads on uploads/* - Bare URL verified: HEAD returns 200 for video files - Eliminates signed URL encoding issues that caused MediaKit 403
This commit is contained in:
@@ -199,7 +199,7 @@ def editor_generate_cover(
|
||||
first_asset = asset_repo.get(body.asset_ids[0])
|
||||
if first_asset and first_asset.storage_key:
|
||||
storage_svc = get_shared_storage_service()
|
||||
primary_video_url = storage_svc.get_download_url(first_asset.storage_key, expires_seconds=3600)
|
||||
primary_video_url = storage_svc.get_url(first_asset.storage_key)
|
||||
logger.info(
|
||||
"获取视频URL用于封面生成: asset_id=%s url=%s",
|
||||
body.asset_ids[0],
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"status": "passed",
|
||||
"failedTests": []
|
||||
}
|
||||
Executable
+105
@@ -0,0 +1,105 @@
|
||||
"""Fix: Pass previewTaskId to useGenerateVideo so confirm generation reuses preview."""
|
||||
import sys
|
||||
|
||||
# ── Fix 1: useStep4Preview.ts — expose selectedTaskId ──
|
||||
filepath1 = 'apps/web/src/pages/generate/hooks/useStep4Preview.ts'
|
||||
with open(filepath1, 'r') as f:
|
||||
content1 = f.read()
|
||||
|
||||
# Add selectedTaskId computation before the return block
|
||||
old_return_block = ''' return {
|
||||
templateName,
|
||||
materialCount,
|
||||
duration,
|
||||
videoRatio,
|
||||
// 多预览状态
|
||||
items,
|
||||
selectedIndex,
|
||||
setSelectedIndex,
|
||||
previewCount,
|
||||
// 综合状态
|
||||
previewStatus,
|
||||
previewResult: selectedResult,
|
||||
previewError,
|
||||
progress,
|
||||
canProceed,
|
||||
allReady,
|
||||
anyReady,
|
||||
anyGenerating,
|
||||
generatePreview,
|
||||
regeneratePreview,
|
||||
}'''
|
||||
|
||||
new_return_block = ''' /** 当前选中预览的 taskId(用于确认生成时复用预览产物) */
|
||||
const selectedTaskId = selectedResult?.taskId ?? ""
|
||||
|
||||
return {
|
||||
templateName,
|
||||
materialCount,
|
||||
duration,
|
||||
videoRatio,
|
||||
// 多预览状态
|
||||
items,
|
||||
selectedIndex,
|
||||
setSelectedIndex,
|
||||
previewCount,
|
||||
// 综合状态
|
||||
previewStatus,
|
||||
previewResult: selectedResult,
|
||||
previewError,
|
||||
progress,
|
||||
canProceed,
|
||||
allReady,
|
||||
anyReady,
|
||||
anyGenerating,
|
||||
generatePreview,
|
||||
regeneratePreview,
|
||||
// 确认生成复用预览产物
|
||||
selectedTaskId,
|
||||
}'''
|
||||
|
||||
if old_return_block not in content1:
|
||||
print('ERROR: return block not found in useStep4Preview.ts!')
|
||||
sys.exit(1)
|
||||
|
||||
content1 = content1.replace(old_return_block, new_return_block)
|
||||
|
||||
with open(filepath1, 'w') as f:
|
||||
f.write(content1)
|
||||
print('OK: useStep4Preview.ts updated')
|
||||
|
||||
# ── Fix 2: GeneratePage.tsx — pass previewTaskId to useGenerateVideo ──
|
||||
filepath2 = 'apps/web/src/pages/generate/GeneratePage.tsx'
|
||||
with open(filepath2, 'r') as f:
|
||||
content2 = f.read()
|
||||
|
||||
old_generate_call = ''' generateCount,
|
||||
})'''
|
||||
|
||||
# Find the useGenerateVideo call context
|
||||
if 'generateCount,\n })' not in content2:
|
||||
# Try with the closing pattern
|
||||
old_pattern = ''' autoSubtitles,
|
||||
bgm,
|
||||
generateCount,
|
||||
})'''
|
||||
if old_pattern not in content2:
|
||||
print('ERROR: useGenerateVideo call not found in GeneratePage.tsx!')
|
||||
# Debug: show the area around the call
|
||||
idx = content2.find('useGenerateVideo({')
|
||||
if idx >= 0:
|
||||
print(f'Found useGenerateVideo at index {idx}')
|
||||
print(repr(content2[idx:idx+600]))
|
||||
sys.exit(1)
|
||||
|
||||
new_pattern = ''' autoSubtitles,
|
||||
bgm,
|
||||
generateCount,
|
||||
previewTaskId: step4Preview.selectedTaskId,
|
||||
})'''
|
||||
|
||||
content2 = content2.replace(old_pattern, new_pattern)
|
||||
|
||||
with open(filepath2, 'w') as f:
|
||||
f.write(content2)
|
||||
print('OK: GeneratePage.tsx updated')
|
||||
Reference in New Issue
Block a user