From 01c16d3ce52030cbf093f48515cdd6f0f769c361 Mon Sep 17 00:00:00 2001 From: Marco Nelissen Date: Mon, 26 Aug 2024 14:19:24 -0700 Subject: [PATCH] www: vue: fix exception due to event.mp4 presence --- src/apis/video.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/apis/video.js b/src/apis/video.js index 2af50ff..1890d91 100644 --- a/src/apis/video.js +++ b/src/apis/video.js @@ -8,10 +8,11 @@ export async function getVideoList() { if (content == "") { return null; } + console.log("got video list content"); const paths = content.split('\n').filter(line => line.trim()); const groups = paths.reduce(function (result, path) { const [group, sequenceName, filename] = path.split('/'); - if (filename.includes('~') || sequenceName.includes('json') || sequenceName.includes('thumb')) { + if (filename == "event.mp4" || filename.includes('~') || sequenceName.includes('json') || sequenceName.includes('thumb')) { return result; } @@ -24,11 +25,14 @@ export async function getVideoList() { const sequence = result[group][sequenceName]; if (filename.includes('.mp4')) { - const {key, date, pos} = parseMp4Filename(filename); - if (!sequence.clips[key]) { - sequence.clips[key] = {key, date}; + try { + const {key, date, pos} = parseMp4Filename(filename); + if (!sequence.clips[key]) { + sequence.clips[key] = {key, date}; + } + sequence.clips[key][pos] = filename; + } catch (e) { } - sequence.clips[key][pos] = filename; } else if (filename.includes('thumb')) { sequence.thumb = filename;