fix(#4 bug): add otherInfo episodes clarification
This commit is contained in:
+22
-1
@@ -45,7 +45,8 @@ async function scrapeHomePage(): Promise<ScrapedHomePage | HttpError> {
|
|||||||
const otherInfo = $(el)
|
const otherInfo = $(el)
|
||||||
.find(".deslide-item-content .sc-detail .scd-item")
|
.find(".deslide-item-content .sc-detail .scd-item")
|
||||||
.map((i, el) => $(el).text().trim())
|
.map((i, el) => $(el).text().trim())
|
||||||
.get();
|
.get()
|
||||||
|
.slice(0, -1);
|
||||||
|
|
||||||
res.spotlightAnimes.push({
|
res.spotlightAnimes.push({
|
||||||
rank:
|
rank:
|
||||||
@@ -81,6 +82,26 @@ async function scrapeHomePage(): Promise<ScrapedHomePage | HttpError> {
|
|||||||
.find(".deslide-item-content .desi-head-title.dynamic-name")
|
.find(".deslide-item-content .desi-head-title.dynamic-name")
|
||||||
?.attr("data-jname")
|
?.attr("data-jname")
|
||||||
?.trim(),
|
?.trim(),
|
||||||
|
episodes: {
|
||||||
|
sub:
|
||||||
|
Number(
|
||||||
|
$(el)
|
||||||
|
.find(
|
||||||
|
".deslide-item-content .sc-detail .scd-item .tick-item.tick-sub"
|
||||||
|
)
|
||||||
|
?.text()
|
||||||
|
?.trim()
|
||||||
|
) || null,
|
||||||
|
dub:
|
||||||
|
Number(
|
||||||
|
$(el)
|
||||||
|
.find(
|
||||||
|
".deslide-item-content .sc-detail .scd-item .tick-item.tick-dub"
|
||||||
|
)
|
||||||
|
?.text()
|
||||||
|
?.trim()
|
||||||
|
) || null,
|
||||||
|
},
|
||||||
otherInfo,
|
otherInfo,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user