From 1068949aa55f92298c1a6ef3ac7f3a1e4730fb70 Mon Sep 17 00:00:00 2001 From: Marcin Majewski Date: Fri, 2 Feb 2024 04:26:53 +0100 Subject: [PATCH] Fix noble time (#743) --- plugins/english/nobleMTL.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/plugins/english/nobleMTL.ts b/plugins/english/nobleMTL.ts index cd46bfe..bfdc506 100644 --- a/plugins/english/nobleMTL.ts +++ b/plugins/english/nobleMTL.ts @@ -112,23 +112,22 @@ class NobleMTL implements Plugin.PluginBase { loadedCheerio(".eplister") .find("li") .each(function () { + const chapterUrl = loadedCheerio(this).find("a").attr("href"); + if (!chapterUrl) return; const chapterName = loadedCheerio(this).find(".epl-num").text() + " - " + loadedCheerio(this).find(".epl-title").text(); - const releaseDate = loadedCheerio(this) .find(".epl-date") .text() - .trim(); + .trim(); // Feb 25, 2024 - const chapterUrl = loadedCheerio(this).find("a").attr("href"); - - if (!chapterUrl) return; + if (!releaseDate) return; chapter.push({ name: chapterName, - releaseTime: releaseDate, + releaseTime: new Date(releaseDate).toISOString(), url: chapterUrl, }); });