From 74da730dc49f747e4b94a489137162a3d10bf1d2 Mon Sep 17 00:00:00 2001 From: AnimeDL Date: Sat, 23 Mar 2024 17:52:40 -0700 Subject: [PATCH] [CR] Fix falsey comparison for chapters Fix chapter being ignored if chapter start time was 0 (thanks javascript falsey comparison) --- crunchy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crunchy.ts b/crunchy.ts index 29674cf..9f825cf 100644 --- a/crunchy.ts +++ b/crunchy.ts @@ -1279,7 +1279,7 @@ export default class Crunchy implements ServiceClass { chapters.sort((a, b) => a.start - b.start); //Loop through all the chapters for (const chapter of chapters) { - if (!chapter.start || !chapter.end) continue; + if (typeof chapter.start == 'undefined' || typeof chapter.end == 'undefined') continue; //Generate timestamps const startTime = new Date(0), endTime = new Date(0); startTime.setSeconds(chapter.start);