修复视频索引逻辑

This commit is contained in:
cc
2026-02-28 19:47:35 +08:00
parent 68c4e43e05
commit 33d5951a14
2 changed files with 89 additions and 35 deletions

View File

@@ -1783,13 +1783,19 @@ class ChatService {
if (!content) return undefined
try {
// 取 md5,这是用于查询 hardlink.db 的值
const md5 =
this.extractXmlAttribute(content, 'videomsg', 'md5') ||
this.extractXmlValue(content, 'md5') ||
undefined
// 优先取 md5 属性(收到的视频)
const md5 = this.extractXmlAttribute(content, 'videomsg', 'md5')
if (md5) return md5.toLowerCase()
return md5?.toLowerCase()
// 自己发的视频没有 md5只有 rawmd5
const rawMd5 = this.extractXmlAttribute(content, 'videomsg', 'rawmd5')
if (rawMd5) return rawMd5.toLowerCase()
// 兜底:<md5> 标签
const tagMd5 = this.extractXmlValue(content, 'md5')
if (tagMd5) return tagMd5.toLowerCase()
return undefined
} catch {
return undefined
}