chore: 合并远程更新并解决batch-pipeline.js冲突

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
lc
2026-05-20 00:11:16 +08:00
parent ac6f110f28
commit b829521492
4 changed files with 34 additions and 19 deletions

View File

@@ -52,6 +52,13 @@
"model": "cosyvoice-v3.5-plus",
"instruction": "音量由正常对话迅速增强至高喊,性格直率,情绪易激动且外露",
"style": "直率激动,由低到高"
},
{
"name": "谢尔比",
"id": "cosyvoice-v3.5-plus-bailian-2e272ca7a5784f0b8e79013c891fe23e",
"model": "cosyvoice-v3.5-plus",
"instruction": "用一种过来人的口吻说话,像是经历了太多懒得废话的大哥,语气里带点漫不经心和不耐烦。声音不用太用力,轻描淡写但每个字都砸在点上。偶尔轻哼一口气,显得很松弛。",
"style": "漫不经心,松弛有力"
}
]
}

View File

@@ -381,12 +381,11 @@ function cmdExport(args) {
}
const forwardFull = [forwardBody, htags].filter(Boolean).join('')
// 选题列topicA方案A> 旧字段 topic > 原 title
const topicDisplay = item.topicA || item.topic || item.title || ''
rows.push({
row: item.row,
选题: topicDisplay,
选题: item.topicA || item.topic || item.title || '',
选题二: item.topicB || '',
脚本: script,
账号: item.account,
模式: item.mode,
@@ -401,19 +400,26 @@ function cmdExport(args) {
rows.sort((a, b) => a.row - b.row)
const format = args.format || 'csv'
const dateStr = formatDate(new Date())
const baseName = path.basename(manifestPath, '.json')
// 生成文件名账号名_MMDD_起号~止号
const accountName = rows[0]?.账号 || batch.defaultAccount || 'unknown'
const dateMMDD = formatDate(new Date()).slice(4) // MMDD
const rowNums = rows.map(r => r.row)
const rowStart = String(Math.min(...rowNums)).padStart(2, '0')
const rowEnd = String(Math.max(...rowNums)).padStart(2, '0')
const exportName = `${accountName}_${dateMMDD}_${rowStart}~${rowEnd}`
if (format === 'xlsx') {
exportXlsx(manifestPath, rows)
exportXlsx(manifestPath, rows, exportName)
} else {
exportCsv(manifestPath, rows)
exportCsv(manifestPath, rows, exportName)
}
}
function exportCsv(manifestPath, rows) {
const outPath = manifestPath.replace('.json', '_export.csv')
const headers = ['选题', '脚本', '账号', '模式', '音色', '转发文案带话题', '草稿名称', '草稿地址']
function exportCsv(manifestPath, rows, exportName) {
const batchDir = path.dirname(manifestPath)
const outPath = path.join(batchDir, `${exportName}.csv`)
const headers = ['选题一', '选题二', '脚本', '账号', '模式', '音色', '转发文案带话题', '草稿名称', '草稿地址']
const lines = [headers.join(',')]
for (const r of rows) {
@@ -437,10 +443,10 @@ function exportCsv(manifestPath, rows) {
printTable(rows, headers)
}
function exportXlsx(manifestPath, rows) {
function exportXlsx(manifestPath, rows, exportName) {
try {
const XLSX = require('xlsx')
const headers = ['选题', '脚本', '账号', '模式', '音色', '转发文案带话题', '草稿名称', '草稿地址']
const headers = ['选题一', '选题二', '脚本', '账号', '模式', '音色', '转发文案带话题', '草稿名称', '草稿地址']
const data = rows.map(r => headers.map(h => r[h] || ''))
data.unshift(headers)
@@ -448,7 +454,8 @@ function exportXlsx(manifestPath, rows) {
const wb = XLSX.utils.book_new()
XLSX.utils.book_append_sheet(wb, ws, '视频清单')
const outPath = manifestPath.replace('.json', '_export.xlsx')
const batchDir = path.dirname(manifestPath)
const outPath = path.join(batchDir, `${exportName}.xlsx`)
XLSX.writeFile(wb, outPath)
console.log(`表格已导出: ${outPath}`)
console.log(`${rows.length} 条记录`)
@@ -458,7 +465,7 @@ function exportXlsx(manifestPath, rows) {
} catch (err) {
if (err.code === 'MODULE_NOT_FOUND') {
console.warn('xlsx 模块未安装,改用 CSV 格式')
exportCsv(manifestPath, rows)
exportCsv(manifestPath, rows, exportName)
} else {
throw err
}