[CR] Chapter Fix

Chapters could fail if for whatever reason the start and end times weren't defined.
This commit is contained in:
AnimeDL 2024-02-07 15:59:22 -08:00
parent d2b4adf09b
commit 3582f1829f

View file

@ -1233,7 +1233,8 @@ export default class Crunchy implements ServiceClass {
chapters.sort((a, b) => a.start - b.start);
//Loop through all the chapters
for (const chapter of chapters) {
//Generate timestamps
if (!chapter.start || !chapter.end) continue;
//Generate timestamps
const startTime = new Date(0), endTime = new Date(0);
startTime.setSeconds(chapter.start);
endTime.setSeconds(chapter.end);