Skip to content

Commit

Permalink
www: vue: fix exception due to event.mp4 presence
Browse files Browse the repository at this point in the history
  • Loading branch information
marcone committed Aug 26, 2024
1 parent bf9ed97 commit 01c16d3
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/apis/video.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
Expand Down

0 comments on commit 01c16d3

Please sign in to comment.