Skip to content

Commit d0eebbf

Browse files
committed
Throw an error if the first chapter does not start at 0:00:00
1 parent 927952c commit d0eebbf

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

markut.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,14 @@ func (context *EvalContext) finishEval() bool {
547547
}
548548
}
549549

550+
if len(context.chapters) > 0 {
551+
first := context.chapters[0]
552+
if first.Timestamp > 0 {
553+
fmt.Printf("%s: ERROR: first chapter must start at 0:00:00 of the output video. But this one starts at %s (See https://support.google.com/youtube/answer/9884579)\n", first.Loc, millisToTs(first.Timestamp));
554+
return false
555+
}
556+
}
557+
550558
if len(context.argsStack) > 0 || len(context.chapStack) > 0 {
551559
for i := range context.argsStack {
552560
fmt.Printf("%s: ERROR: unused argument\n", context.argsStack[i].Loc)

0 commit comments

Comments
 (0)