Skip to content

Commit

Permalink
fix(#4 bug): add otherInfo episodes clarification
Browse files Browse the repository at this point in the history
  • Loading branch information
ghoshRitesh12 committed Nov 22, 2023
1 parent f2a47e3 commit 4afc916
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion src/parsers/homePage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ async function scrapeHomePage(): Promise<ScrapedHomePage | HttpError> {
const otherInfo = $(el)
.find(".deslide-item-content .sc-detail .scd-item")
.map((i, el) => $(el).text().trim())
.get();
.get()
.slice(0, -1);

res.spotlightAnimes.push({
rank:
Expand Down Expand Up @@ -81,6 +82,26 @@ async function scrapeHomePage(): Promise<ScrapedHomePage | HttpError> {
.find(".deslide-item-content .desi-head-title.dynamic-name")
?.attr("data-jname")
?.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,
});
});
Expand Down

0 comments on commit 4afc916

Please sign in to comment.