readlightnovel: add volume number in chapter name
This commit is contained in:
@@ -95,28 +95,36 @@ 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();
|
||||||
.each(function (result) {
|
|
||||||
chapterName = $(this)
|
|
||||||
.find("a")
|
|
||||||
.text()
|
|
||||||
.replace(/[\t\n]/g, "")
|
|
||||||
.trim();
|
|
||||||
|
|
||||||
releaseDate = null;
|
$(this)
|
||||||
|
.find("ul.chapter-chs > li")
|
||||||
|
.each(function (result) {
|
||||||
|
chapterName = $(this)
|
||||||
|
.find("a")
|
||||||
|
.text()
|
||||||
|
.replace(/[\t\n]/g, "")
|
||||||
|
.trim();
|
||||||
|
|
||||||
chapterUrl = $(this)
|
releaseDate = null;
|
||||||
.find("a")
|
|
||||||
.attr("href")
|
|
||||||
.replace(baseUrl, "");
|
|
||||||
|
|
||||||
novelChapters.push({
|
chapterUrl = $(this)
|
||||||
chapterName,
|
.find("a")
|
||||||
releaseDate,
|
.attr("href")
|
||||||
chapterUrl: chapterUrl.replace(`/${novelUrl}/`, ""),
|
.replace(baseUrl, "");
|
||||||
|
|
||||||
|
if (volumeName.includes("Volume")) {
|
||||||
|
chapterName = volumeName + " " + chapterName;
|
||||||
|
}
|
||||||
|
|
||||||
|
novelChapters.push({
|
||||||
|
chapterName,
|
||||||
|
releaseDate,
|
||||||
|
chapterUrl: chapterUrl.replace(`/${novelUrl}/`, ""),
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
novel.novelChapters = novelChapters;
|
novel.novelChapters = novelChapters;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user