Fix zero start time breaking

This commit is contained in:
Ajay
2022-10-07 12:19:42 -04:00
parent dabc63af73
commit 61fc1d2ed3
2 changed files with 22 additions and 1 deletions

View File

@@ -38,7 +38,7 @@ export function importTimes(data: string, videoDuration: number): SponsorTime[]
const match = line.match(/(?:((?:\d+:)?\d+:\d+)+(?:\.\d+)?)|(?:\d+(?=s| second))/g);
if (match) {
const startTime = GenericUtils.getFormattedTimeToSeconds(match[0]);
if (startTime) {
if (startTime !== null) {
const specialCharsMatcher = /^(?:\s+seconds?)?[-:()\s]*|(?:\s+at)?[-:()\s]+$/g
const titleLeft = line.split(match[0])[0].replace(specialCharsMatcher, "");
let titleRight = null;