feat: now support make any record starred

This commit is contained in:
2025-07-02 21:39:41 +08:00
parent 6e2976e234
commit acde78f4a0
8 changed files with 618 additions and 129 deletions
+1 -7
View File
@@ -24,18 +24,12 @@ export async function compressPics(hostname: string, startTime: Date, endTime: D
}
})
// 有两种情况不进行处理:
// 1. 每个记录中有多于一个截图
// 2. 时间段内截图有多种分辨率
const picNames = records.map(record => {
return record.screenshots.map(screenshot => screenshot.objectName)
}).flat();
const picBuffers = (await Promise.all(picNames.map(name => getFileByObjectName(name)))).filter(buffer => buffer !== null && buffer !== undefined);
// 先默认不存在null吧
const vBuffer = await compressImagesToAv1Video(picBuffers)
storeFile(vBuffer, 'test.mp4', 'video/mp4', 'other', hostname)
@@ -44,4 +38,4 @@ export async function compressPics(hostname: string, startTime: Date, endTime: D
//DESKTOP-JHHNH9C startTime=1751104800 1751108400
compressPics('DESKTOP-JHHNH9C', new Date(1751104800000), new Date(1751108400000))
/* compressPics('DESKTOP-JHHNH9C', new Date(1751104800000), new Date(1751108400000)) */