fix(otherInfoBug): otherInfo wouldn't show all stats
This commit is contained in:
+17
-13
@@ -143,18 +143,6 @@ export function extractMostPopularAnimes(
|
|||||||
const animes: Array<MostPopularAnime> = [];
|
const animes: Array<MostPopularAnime> = [];
|
||||||
|
|
||||||
$(selector).each((i, el) => {
|
$(selector).each((i, el) => {
|
||||||
const otherInfoSrc = $(el)
|
|
||||||
?.find(".fd-infor .tick")
|
|
||||||
?.text()
|
|
||||||
?.trim()
|
|
||||||
?.replace(/\n/g, "")
|
|
||||||
.split(" ");
|
|
||||||
|
|
||||||
let otherInfos: string[] = [
|
|
||||||
otherInfoSrc[0] || "",
|
|
||||||
otherInfoSrc?.pop() || "",
|
|
||||||
];
|
|
||||||
|
|
||||||
animes.push({
|
animes.push({
|
||||||
id:
|
id:
|
||||||
$(el)
|
$(el)
|
||||||
@@ -173,7 +161,23 @@ export function extractMostPopularAnimes(
|
|||||||
.find(".film-detail .film-name .dynamic-name")
|
.find(".film-detail .film-name .dynamic-name")
|
||||||
.attr("data-jname")
|
.attr("data-jname")
|
||||||
?.trim() || null,
|
?.trim() || null,
|
||||||
otherInfo: otherInfos.filter((i) => i !== ""),
|
|
||||||
|
episodes: {
|
||||||
|
sub:
|
||||||
|
Number($(el)?.find(".fd-infor .tick .tick-sub")?.text()?.trim()) ||
|
||||||
|
null,
|
||||||
|
dub:
|
||||||
|
Number($(el)?.find(".fd-infor .tick .tick-dub")?.text()?.trim()) ||
|
||||||
|
null,
|
||||||
|
},
|
||||||
|
type:
|
||||||
|
$(el)
|
||||||
|
?.find(".fd-infor .tick")
|
||||||
|
?.text()
|
||||||
|
?.trim()
|
||||||
|
?.replace(/[\s\n]+/g, " ")
|
||||||
|
?.split(" ")
|
||||||
|
?.pop() || null,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user