mirror of
https://wget.la/https://github.com/Wxw-Gu/WechatExplorer
synced 2026-12-01 17:25:15 +08:00
feat: 知识库更新,优化批量语音转写 - 合并索引 - 增加会话级批量转写处理 - 补充语音转写回归测试
This commit is contained in:
1 parent
eee84f35df
commit
b5f67c47e5
34 files changed
+2589
-53
No files matched your search
@@ -0,0 +1,25 @@
|
||||
import { createHash } from 'crypto'
|
||||
import type { VoiceMessageReference } from '../../shared/voice-recognition'
|
||||
|
||||
/**
|
||||
* Stable, account-local identity for a source voice message. This is separate
|
||||
* from scheduler keys and is shared by every transcription entry point.
|
||||
*/
|
||||
export function voiceMessageIdentity(reference: VoiceMessageReference): string {
|
||||
return createHash('sha256')
|
||||
.update(
|
||||
`${reference.sessionId}|${reference.localId}|${reference.createTime}|${reference.svrId ?? ''}`
|
||||
)
|
||||
.digest('hex')
|
||||
}
|
||||
|
||||
export function voiceAccountIdentity(accountRoot: string): string {
|
||||
return createHash('sha256')
|
||||
.update(
|
||||
accountRoot
|
||||
.trim()
|
||||
.replace(/[\\/]+$/, '')
|
||||
.toLowerCase()
|
||||
)
|
||||
.digest('hex')
|
||||
}
|
||||
Reference in new issue
Block a user