fix chapterUrl to avoid duplicate chapters

This commit is contained in:
Rajarshee Chatterjee
2021-04-30 11:02:43 +05:30
parent cfd31bea02
commit eb352ae7ac
3 changed files with 17 additions and 13 deletions
+5 -4
View File
@@ -82,16 +82,17 @@ router.get("/novel/:novelUrl", (req, res) => {
let novelChapters = [];
$(".chapter").each(function (result) {
chapterName = $(this).text();
let chapterName = $(this).text();
releaseDate = null;
let releaseDate = null;
chapterUrl = $(this).attr("href");
let chapterUrl = $(this).attr("href");
chapterUrl = chapterUrl.replace(`/${novelUrl}/`, "");
novelChapters.push({
chapterName,
releaseDate,
chapterUrl: chapterUrl.replace(`/${novelUrl}/`, ""),
chapterUrl,
});
});