feat(video-pipeline): 增强参考图自动上传与视频生成重试机制
- 在 `init-manifest` 阶段添加输入文件清理日志和 WARNING 提示 - `getReferences` 改为异步并自动将本地参考图上传至 OSS,减少手动操作 - `phase-videos` 支持 `pending`/`failed` 状态 item 的自动重试,自动清理旧视频引用 - 优化 `phase-assemble` 中字幕与配音开关的逻辑,根据实际内容动态判断
This commit is contained in:
@@ -27,6 +27,8 @@ function initManifest(options) {
|
||||
process.exit(1)
|
||||
}
|
||||
rawItems = JSON.parse(fs.readFileSync(filePath, 'utf-8'))
|
||||
console.log(` 已读取并清理临时文件: ${path.basename(filePath)}`)
|
||||
fs.unlinkSync(filePath)
|
||||
} else if (itemsJson) {
|
||||
rawItems = JSON.parse(itemsJson)
|
||||
} else {
|
||||
@@ -57,7 +59,7 @@ function initManifest(options) {
|
||||
}
|
||||
}
|
||||
|
||||
// 从 account.json 继承参考图(顶层 references)
|
||||
// 从 account.json 继承参考图(顶层 references),仅使用带签名 OSS URL 的条目
|
||||
const accountRefs = accountConfig.references || []
|
||||
const references = accountRefs.map(ref => {
|
||||
const entry = {}
|
||||
@@ -65,6 +67,10 @@ function initManifest(options) {
|
||||
if (ref.url) entry.url = ref.url
|
||||
return entry
|
||||
})
|
||||
const refsWithoutUrl = references.filter(r => !r.url)
|
||||
if (refsWithoutUrl.length > 0) {
|
||||
console.log(` ⚠ ${refsWithoutUrl.length} 个参考图缺少 OSS URL,images 阶段会自动上传`)
|
||||
}
|
||||
|
||||
// 构建 items
|
||||
const items = rawItems.map((raw, i) => {
|
||||
|
||||
Reference in New Issue
Block a user