mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-03-25 07:16:51 +00:00
Merge pull request #1 from 5xiao0qing5/codex/locate-cause-of-export-speech-to-text-bug
Fix exporting voice-to-text for JSON and Excel exports
This commit is contained in:
@@ -1250,13 +1250,18 @@ class ExportService {
|
|||||||
const sourceMatch = /<msgsource>[\s\S]*?<\/msgsource>/i.exec(msg.content || '')
|
const sourceMatch = /<msgsource>[\s\S]*?<\/msgsource>/i.exec(msg.content || '')
|
||||||
const source = sourceMatch ? sourceMatch[0] : ''
|
const source = sourceMatch ? sourceMatch[0] : ''
|
||||||
|
|
||||||
|
let content = this.parseMessageContent(msg.content, msg.localType)
|
||||||
|
if (msg.localType === 34 && options.exportVoiceAsText) {
|
||||||
|
content = await this.transcribeVoice(sessionId, String(msg.localId))
|
||||||
|
}
|
||||||
|
|
||||||
allMessages.push({
|
allMessages.push({
|
||||||
localId: allMessages.length + 1,
|
localId: allMessages.length + 1,
|
||||||
createTime: msg.createTime,
|
createTime: msg.createTime,
|
||||||
formattedTime: this.formatTimestamp(msg.createTime),
|
formattedTime: this.formatTimestamp(msg.createTime),
|
||||||
type: this.getMessageTypeName(msg.localType),
|
type: this.getMessageTypeName(msg.localType),
|
||||||
localType: msg.localType,
|
localType: msg.localType,
|
||||||
content: this.parseMessageContent(msg.content, msg.localType),
|
content,
|
||||||
isSend: msg.isSend ? 1 : 0,
|
isSend: msg.isSend ? 1 : 0,
|
||||||
senderUsername: msg.senderUsername,
|
senderUsername: msg.senderUsername,
|
||||||
senderDisplayName: senderInfo.displayName,
|
senderDisplayName: senderInfo.displayName,
|
||||||
@@ -1541,9 +1546,12 @@ class ExportService {
|
|||||||
row.height = 24
|
row.height = 24
|
||||||
|
|
||||||
// 确定内容:如果有媒体文件导出成功则显示相对路径,否则显示解析后的内容
|
// 确定内容:如果有媒体文件导出成功则显示相对路径,否则显示解析后的内容
|
||||||
const contentValue = mediaItem
|
let contentValue = mediaItem
|
||||||
? mediaItem.relativePath
|
? mediaItem.relativePath
|
||||||
: (this.parseMessageContent(msg.content, msg.localType) || '')
|
: (this.parseMessageContent(msg.content, msg.localType) || '')
|
||||||
|
if (!mediaItem && msg.localType === 34 && options.exportVoiceAsText) {
|
||||||
|
contentValue = await this.transcribeVoice(sessionId, String(msg.localId))
|
||||||
|
}
|
||||||
|
|
||||||
// 调试日志
|
// 调试日志
|
||||||
if (msg.localType === 3 || msg.localType === 47) {
|
if (msg.localType === 3 || msg.localType === 47) {
|
||||||
@@ -1689,4 +1697,3 @@ class ExportService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const exportService = new ExportService()
|
export const exportService = new ExportService()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user