novelhall: fix novel chapters

This commit is contained in:
Rajarshee Chatterjee
2021-04-28 10:29:13 +05:30
parent 8224547889
commit 7f881b89a5
+14 -12
View File
@@ -80,23 +80,25 @@ router.get("/novel/:novelUrl", (req, res) => {
let novelChapters = [];
$("li.post-11").each(function (result) {
let chapterName = $(this).find("a").text();
$("div.book-catalog.hidden-xs#morelist")
.find("li.post-11")
.each(function (result) {
let chapterName = $(this).find("a").text();
let releaseDate = null;
let releaseDate = null;
let chapterUrl = $(this).find("a").attr("href");
let chapterUrl = $(this).find("a").attr("href");
if (chapterUrl) {
chapterUrl = chapterUrl.replace(`/${novelUrl}/`, "");
}
if (chapterUrl) {
chapterUrl = chapterUrl.replace(`/${novelUrl}/`, "");
}
novelChapters.push({
chapterName,
releaseDate,
chapterUrl,
novelChapters.push({
chapterName,
releaseDate,
chapterUrl,
});
});
});
novel.novelChapters = novelChapters;