feat ui: optimize canvas recording

This commit is contained in:
nick-delirium 2024-06-07 13:35:01 +02:00
parent 5db94fc172
commit 51e66271f6
No known key found for this signature in database
GPG key ID: 93ABD695DF5FDBA0
2 changed files with 2 additions and 2 deletions

View file

@ -12,7 +12,7 @@ export default class SnapshotManager extends ListWalker<Timestamp> {
private snapshots: Snapshots = {}
public mapToSnapshots(files: TarFile[]) {
const filenameRegexp = /(\d+)_1_(\d+)\.jpeg$/;
const filenameRegexp = /(\d+)_1_(\d+)\.(jpeg|webp)$/;
const firstPair = files[0].name.match(filenameRegexp)
const sessionStart = firstPair ? parseInt(firstPair[1], 10) : 0
files.forEach(file => {

View file

@ -86,7 +86,7 @@ export default class CanvasManager extends ListWalker<Timestamp> {
public mapToSnapshots(files: TarFile[]) {
const tempArr: Timestamp[] = [];
const filenameRegexp = /(\d+)_(\d+)_(\d+)\.webp$/;
const filenameRegexp = /(\d+)_(\d+)_(\d+)\.(jpeg|webp)$/;
const firstPair = files[0].name.match(filenameRegexp);
if (!firstPair) {
console.error('Invalid file name format', files[0].name);