mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-27 12:51:03 +00:00
fix: fixing typechecks
This commit is contained in:
@@ -19,17 +19,17 @@ export const getNewRepacksFromCPG = async (
|
||||
try {
|
||||
Array.from(window.document.querySelectorAll(".post")).forEach(($post) => {
|
||||
const $title = $post.querySelector(".entry-title");
|
||||
const uploadDate = $post.querySelector("time").getAttribute("datetime");
|
||||
const uploadDate = $post.querySelector("time")?.getAttribute("datetime");
|
||||
|
||||
const $downloadInfo = Array.from(
|
||||
$post.querySelectorAll(".wp-block-heading")
|
||||
).find(($heading) => $heading.textContent.startsWith("Download"));
|
||||
).find(($heading) => $heading.textContent?.startsWith("Download"));
|
||||
|
||||
/* Side note: CPG often misspells "Magnet" as "Magent" */
|
||||
const $magnet = Array.from($post.querySelectorAll("a")).find(
|
||||
($a) =>
|
||||
$a.textContent.startsWith("Magnet") ||
|
||||
$a.textContent.startsWith("Magent")
|
||||
$a.textContent?.startsWith("Magnet") ||
|
||||
$a.textContent?.startsWith("Magent")
|
||||
);
|
||||
|
||||
const fileSize = $downloadInfo.textContent
|
||||
|
||||
@@ -2,4 +2,4 @@ export * from "./1337x";
|
||||
export * from "./xatab";
|
||||
export * from "./cpg-repacks";
|
||||
export * from "./gog";
|
||||
// export * from "./online-fix";
|
||||
export * from "./online-fix";
|
||||
|
||||
@@ -88,7 +88,7 @@ export const getNewRepacksFromOnlineFix = async (
|
||||
const repacks: GameRepackInput[] = [];
|
||||
const articles = Array.from(document.querySelectorAll(".news"));
|
||||
const totalPages = Number(
|
||||
document.querySelector("nav > a:nth-child(13)").textContent
|
||||
document.querySelector("nav > a:nth-child(13)")?.textContent
|
||||
);
|
||||
|
||||
try {
|
||||
@@ -186,8 +186,10 @@ export const getNewRepacksFromOnlineFix = async (
|
||||
});
|
||||
})
|
||||
);
|
||||
} catch (err) {
|
||||
logger.error(err.message, { method: "getNewRepacksFromOnlineFix" });
|
||||
} catch (err: unknown) {
|
||||
logger.error((err as Error).message, {
|
||||
method: "getNewRepacksFromOnlineFix",
|
||||
});
|
||||
}
|
||||
|
||||
const newRepacks = repacks.filter(
|
||||
|
||||
Reference in New Issue
Block a user