[CR] Fix falsey comparison for chapters

Fix chapter being ignored if chapter start time was 0 (thanks javascript falsey comparison)
This commit is contained in:
AnimeDL 2024-03-23 17:52:40 -07:00
parent 250c8925a4
commit 74da730dc4

View file

@ -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);