revert chapter object
This commit is contained in:
@@ -103,21 +103,21 @@ router.get("/novel/:novelUrl", (req, res) => {
|
|||||||
let novelChapters = [];
|
let novelChapters = [];
|
||||||
|
|
||||||
$(".wp-manga-chapter").each(function (result) {
|
$(".wp-manga-chapter").each(function (result) {
|
||||||
let name = $(this)
|
chapterName = $(this)
|
||||||
.find("a")
|
.find("a")
|
||||||
.text()
|
.text()
|
||||||
.replace(/[\t\n]/g, "")
|
.replace(/[\t\n]/g, "")
|
||||||
.trim();
|
.trim();
|
||||||
|
|
||||||
let date_upload = $(this)
|
releaseDate = $(this)
|
||||||
.find("span")
|
.find("span")
|
||||||
.text()
|
.text()
|
||||||
.replace(/[\t\n]/g, "")
|
.replace(/[\t\n]/g, "")
|
||||||
.trim();
|
.trim();
|
||||||
|
|
||||||
chapter_url = $(this).find("a").attr("href").replace(url, "");
|
chapterUrl = $(this).find("a").attr("href").replace(url, "");
|
||||||
|
|
||||||
novelChapters.push({ name, date_upload, chapter_url });
|
novelChapters.push({ chapterName, releaseDate, chapterUrl });
|
||||||
});
|
});
|
||||||
|
|
||||||
novel.novelChapters = novelChapters.reverse();
|
novel.novelChapters = novelChapters.reverse();
|
||||||
@@ -194,6 +194,25 @@ router.get("/search/", (req, res) => {
|
|||||||
$(".c-tabs-item__content").each(function (result) {
|
$(".c-tabs-item__content").each(function (result) {
|
||||||
novelName = $(this).find("h4 > a").text();
|
novelName = $(this).find("h4 > a").text();
|
||||||
|
|
||||||
|
// let novelDetails = {};
|
||||||
|
|
||||||
|
// $(this)
|
||||||
|
// .find(".post-content_item")
|
||||||
|
// .each(function (result) {
|
||||||
|
// detailName = $(this)
|
||||||
|
// .find(".summary-heading > h5")
|
||||||
|
// .text()
|
||||||
|
// .replace(/[\t\n]/g, "")
|
||||||
|
// .trim();
|
||||||
|
// detail = $(this)
|
||||||
|
// .find(".summary-content")
|
||||||
|
// .text()
|
||||||
|
// .replace(/[\t\n]/g, "")
|
||||||
|
// .trim();
|
||||||
|
|
||||||
|
// novelDetails[detailName] = detail;
|
||||||
|
// });
|
||||||
|
|
||||||
novelCover = $(this).find("img").attr("src");
|
novelCover = $(this).find("img").attr("src");
|
||||||
|
|
||||||
novelUrl = $(this)
|
novelUrl = $(this)
|
||||||
|
|||||||
@@ -97,23 +97,28 @@ router.get("/novel/:novelUrl", (req, res) => {
|
|||||||
$(".tab-content")
|
$(".tab-content")
|
||||||
.find("li")
|
.find("li")
|
||||||
.each(function (result) {
|
.each(function (result) {
|
||||||
let name = $(this)
|
chapterName = $(this)
|
||||||
.find("a")
|
.find("a")
|
||||||
.text()
|
.text()
|
||||||
.replace(/[\t\n]/g, "")
|
.replace(/[\t\n]/g, "")
|
||||||
.trim();
|
.trim();
|
||||||
|
|
||||||
date_upload = null;
|
releaseDate = null;
|
||||||
|
// $(this)
|
||||||
|
// .find("span")
|
||||||
|
// .text()
|
||||||
|
// .replace(/[\t\n]/g, "")
|
||||||
|
// .trim();
|
||||||
|
|
||||||
chapter_url = $(this)
|
chapterUrl = $(this)
|
||||||
.find("a")
|
.find("a")
|
||||||
.attr("href")
|
.attr("href")
|
||||||
.replace(baseUrl, "");
|
.replace(baseUrl, "");
|
||||||
|
|
||||||
novelChapters.push({
|
novelChapters.push({
|
||||||
name,
|
chapterName,
|
||||||
date_upload,
|
releaseDate,
|
||||||
chapter_url: chapter_url.replace(`/${novelUrl}/`, ""),
|
chapterUrl: chapterUrl.replace(`/${novelUrl}/`, ""),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user