fix broken chapter parsing

pull/539/head
Mikael Finstad 2020-12-08 23:00:47 +01:00
rodzic 18141e2874
commit 44cd0cd810
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -349,8 +349,8 @@ export async function tryReadChaptersToEdl(filePath) {
try {
const { stdout } = await runFfprobe(['-i', filePath, '-show_chapters', '-print_format', 'json']);
return JSON.parse(stdout).chapters.map((chapter) => {
const start = parseInt(chapter.start_time, 10);
const end = parseInt(chapter.end_time, 10);
const start = parseFloat(chapter.start_time);
const end = parseFloat(chapter.end_time);
if (Number.isNaN(start) || Number.isNaN(end)) return undefined;
const name = chapter.tags && typeof chapter.tags.title === 'string' ? chapter.tags.title : undefined;