修复bug,针对部分没有MD5名字的视频也能支持导出

This commit is contained in:
Nanin
2026-08-08 19:41:14 +08:00
parent f2c58f39b0
commit 666d8896ee
12 changed files with 107 additions and 13 deletions
+10 -2
View File
@@ -30,6 +30,7 @@ const state = vi.hoisted(() => ({
voiceLookups: [] as number[],
videoLookups: [] as {
createTime?: number
byteLength?: number
duration?: number
width?: number
height?: number
@@ -163,7 +164,13 @@ vi.mock('../../src/main/video-asset-service', () => ({
VideoAssetService: class {
resolve(
_hashes: string[],
options?: { createTime?: number; duration?: number; width?: number; height?: number }
options?: {
createTime?: number
byteLength?: number
duration?: number
width?: number
height?: number
}
): { success: boolean; url: string } {
state.videoLookups.push(options || {})
return { success: true, url: 'wxe-media://local/fixture-video' }
@@ -255,7 +262,7 @@ describe('media export flow', () => {
type: '视频',
contentData: {
type: 'video',
md5: 'b'.repeat(32),
byteLength: 6402169,
duration: 68,
width: 279,
height: 630
@@ -326,6 +333,7 @@ describe('media export flow', () => {
})
expect(state.videoLookups[0]).toEqual({
createTime: 1_785_549_600,
byteLength: 6402169,
duration: 68,
width: 279,
height: 630