Skip to content

Commit

Permalink
Merge pull request #6 from ghoshRitesh12/home/otherInfo
Browse files Browse the repository at this point in the history
fix(#4 bug): add otherInfo episodes clarification
  • Loading branch information
ghoshRitesh12 authored Nov 22, 2023
2 parents f2a47e3 + 4afc916 commit c6e4886
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 c6e4886

Please sign in to comment.