feat: mac 档案与导出支持加载原图原视频

This commit is contained in:
Wxw-Gu committed 2026-12-01 10:40:58 +08:00
1 parent fccca5b459
commit b20e514c90
31 files changed
+1884 -111

No files matched your search

+24
View File
@@ -180,4 +180,28 @@ describe('VideoAssetService local fallback', () => {
expect(result).toEqual({ success: false, error: '本地未找到该视频文件' })
})
it('registers a newly downloaded video and pairs it with an existing thumbnail poster', async () => {
const { accountRoot, service } = createService()
const month = join(accountRoot, 'msg', 'video', '2026-11')
mkdirSync(month, { recursive: true })
const stem = '7f3c9a2e5b1d804fc6a7e93b2d10f854'
const posterPath = join(month, `${stem}_thumb.jpg`)
writeFileSync(posterPath, jpegFixture(219, 360))
const beforeDownload = await service.resolve([stem])
expect(beforeDownload.success).toBe(false)
expect(service.pathForUrl(beforeDownload.poster!)).toBe(posterPath)
const downloadedRawPath = join(month, `${stem}_raw.mp4`)
writeFileSync(downloadedRawPath, mp4Fixture(6, 'downloaded-raw-video'))
const registered = service.registerDownloadedVideo([stem], downloadedRawPath, true)
expect(service.pathForUrl(registered.url)).toBe(downloadedRawPath)
expect(service.pathForUrl(registered.poster!)).toBe(posterPath)
const afterDownload = await service.resolve([stem])
expect(afterDownload.success).toBe(true)
expect(service.pathForUrl(afterDownload.url!)).toBe(downloadedRawPath)
expect(service.pathForUrl(afterDownload.poster!)).toBe(posterPath)
})
})