readlightnovel: add volume number in chapter name

This commit is contained in:
Rajarshee Chatterjee
2021-04-28 12:28:46 +05:30
parent b09c11e55d
commit 38395738d5
+10 -2
View File
@@ -95,8 +95,11 @@ router.get("/novel/:novelUrl", (req, res) => {
let novelChapters = []; let novelChapters = [];
$(".tab-content") $(".panel").each(function (res) {
.find("li") let volumeName = $(this).find("h4.panel-title").text();
$(this)
.find("ul.chapter-chs > li")
.each(function (result) { .each(function (result) {
chapterName = $(this) chapterName = $(this)
.find("a") .find("a")
@@ -111,12 +114,17 @@ router.get("/novel/:novelUrl", (req, res) => {
.attr("href") .attr("href")
.replace(baseUrl, ""); .replace(baseUrl, "");
if (volumeName.includes("Volume")) {
chapterName = volumeName + " " + chapterName;
}
novelChapters.push({ novelChapters.push({
chapterName, chapterName,
releaseDate, releaseDate,
chapterUrl: chapterUrl.replace(`/${novelUrl}/`, ""), chapterUrl: chapterUrl.replace(`/${novelUrl}/`, ""),
}); });
}); });
});
novel.novelChapters = novelChapters; novel.novelChapters = novelChapters;