From 893cdb4d929359d941c20394b26ce6febcc53abe Mon Sep 17 00:00:00 2001 From: xuncha <1658671838@qq.com> Date: Wed, 28 Jan 2026 19:31:29 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8Decxel=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- electron/services/exportService.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/electron/services/exportService.ts b/electron/services/exportService.ts index f5e750b..7ee4c44 100644 --- a/electron/services/exportService.ts +++ b/electron/services/exportService.ts @@ -2364,12 +2364,15 @@ class ExportService { const row = worksheet.getRow(currentRow) row.height = 24 - const contentValue = this.formatPlainExportContent( - msg.content, - msg.localType, - options, - voiceTranscriptMap.get(msg.localId) - ) + const mediaKey = `${msg.localType}_${msg.localId}` + const mediaItem = mediaCache.get(mediaKey) + const contentValue = mediaItem?.relativePath + || this.formatPlainExportContent( + msg.content, + msg.localType, + options, + voiceTranscriptMap.get(msg.localId) + ) // 调试日志 if (msg.localType === 3 || msg.localType === 47) { From e63f9014784f467e641f7bb0da699fee2bf95097 Mon Sep 17 00:00:00 2001 From: xuncha <1658671838@qq.com> Date: Wed, 28 Jan 2026 19:55:39 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- electron/services/imageDecryptService.ts | 57 ++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 3 deletions(-) diff --git a/electron/services/imageDecryptService.ts b/electron/services/imageDecryptService.ts index aae33f9..fedc3d5 100644 --- a/electron/services/imageDecryptService.ts +++ b/electron/services/imageDecryptService.ts @@ -415,8 +415,14 @@ export class ImageDecryptService { if (imageDatName) this.cacheDatPath(accountDir, imageDatName, hardlinkPath) return hardlinkPath } - // hardlink 找到的是缩略图,但要求高清图,直接返回 null,不再搜索 + // hardlink 找到的是缩略图,但要求高清图:尝试同目录查找高清变体 if (!allowThumbnail && isThumb) { + const hdPath = this.findHdVariantInSameDir(hardlinkPath) + if (hdPath) { + this.cacheDatPath(accountDir, imageMd5, hdPath) + if (imageDatName) this.cacheDatPath(accountDir, imageDatName, hdPath) + return hdPath + } return null } } @@ -432,6 +438,11 @@ export class ImageDecryptService { return fallbackPath } if (!allowThumbnail && isThumb) { + const hdPath = this.findHdVariantInSameDir(fallbackPath) + if (hdPath) { + this.cacheDatPath(accountDir, imageDatName, hdPath) + return hdPath + } return null } } @@ -449,15 +460,20 @@ export class ImageDecryptService { this.cacheDatPath(accountDir, imageDatName, hardlinkPath) return hardlinkPath } - // hardlink 找到的是缩略图,但要求高清图,直接返回 null + // hardlink 找到的是缩略图,但要求高清图:尝试同目录查找高清变体 if (!allowThumbnail && isThumb) { + const hdPath = this.findHdVariantInSameDir(hardlinkPath) + if (hdPath) { + this.cacheDatPath(accountDir, imageDatName, hdPath) + return hdPath + } return null } } this.logInfo('[ImageDecrypt] hardlink miss (datName)', { imageDatName }) } - // 如果要求高清图但 hardlink 没找到,也不要搜索了(搜索太慢) + // 如果要求高清图但 hardlink 没找到,也不要搜索全盘了(搜索太慢) if (!allowThumbnail) { return null } @@ -467,6 +483,9 @@ export class ImageDecryptService { const cached = this.resolvedCache.get(imageDatName) if (cached && existsSync(cached)) { if (allowThumbnail || !this.isThumbnailPath(cached)) return cached + // 缓存的是缩略图,尝试同目录找高清变体 + const hdPath = this.findHdVariantInSameDir(cached) + if (hdPath) return hdPath } } @@ -511,6 +530,38 @@ export class ImageDecryptService { return this.searchDatFile(accountDir, imageDatName, true, true) } + /** + * 在同目录中尝试查找高清图变体 + * 缩略图: xxx_t.dat / xxx.t.dat -> 高清图: xxx_h.dat / xxx.h.dat / xxx.dat + */ + private findHdVariantInSameDir(thumbPath: string): string | null { + try { + const dir = dirname(thumbPath) + const fileName = basename(thumbPath).toLowerCase() + + let baseName = fileName + if (baseName.endsWith('_t.dat')) { + baseName = baseName.slice(0, -6) + } else if (baseName.endsWith('.t.dat')) { + baseName = baseName.slice(0, -6) + } else { + return null + } + + const variants = [ + `${baseName}_h.dat`, + `${baseName}.h.dat`, + `${baseName}.dat` + ] + + for (const variant of variants) { + const candidate = join(dir, variant) + if (existsSync(candidate)) return candidate + } + } catch { } + return null + } + private async checkHasUpdate( payload: { sessionId?: string; imageMd5?: string; imageDatName?: string }, cacheKey: string, From b6c9f2b32b71e891c02aef401938b0eca485ff17 Mon Sep 17 00:00:00 2001 From: xuncha <1658671838@qq.com> Date: Wed, 28 Jan 2026 20:05:48 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dtxt=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E4=B8=8D=E6=98=A0=E5=B0=84=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- electron/services/exportService.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/electron/services/exportService.ts b/electron/services/exportService.ts index 7ee4c44..5e22b79 100644 --- a/electron/services/exportService.ts +++ b/electron/services/exportService.ts @@ -2546,12 +2546,15 @@ class ExportService { for (let i = 0; i < sortedMessages.length; i++) { const msg = sortedMessages[i] - const contentValue = this.formatPlainExportContent( - msg.content, - msg.localType, - options, - voiceTranscriptMap.get(msg.localId) - ) + const mediaKey = `${msg.localType}_${msg.localId}` + const mediaItem = mediaCache.get(mediaKey) + const contentValue = mediaItem?.relativePath + || this.formatPlainExportContent( + msg.content, + msg.localType, + options, + voiceTranscriptMap.get(msg.localId) + ) let senderRole: string let senderWxid: string