mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-01-23 21:44:55 +03:00
refactor: Update function names in repack tracker to use 'savePage' instead of 'saveRepacks'
This commit is contained in:
parent
02417dda40
commit
4616f69a29
@ -3,7 +3,7 @@ import { JSDOM } from "jsdom";
|
||||
import { formatUploadDate } from "@main/helpers";
|
||||
|
||||
import { Repack } from "@main/entity";
|
||||
import { requestWebPage, saveRepacks } from "./helpers";
|
||||
import { requestWebPage, savePage } from "./helpers";
|
||||
|
||||
export const request1337x = async (path: string) =>
|
||||
requestWebPage(`https://1337xx.to${path}`);
|
||||
@ -114,7 +114,7 @@ export const getNewRepacksFromUser = async (
|
||||
|
||||
if (!newRepacks.length) return;
|
||||
|
||||
await saveRepacks(newRepacks);
|
||||
await savePage(newRepacks);
|
||||
|
||||
return getNewRepacksFromUser(user, existingRepacks, page + 1);
|
||||
};
|
||||
|
@ -2,7 +2,7 @@ import { JSDOM } from "jsdom";
|
||||
|
||||
import { Repack } from "@main/entity";
|
||||
|
||||
import { requestWebPage, saveRepacks } from "./helpers";
|
||||
import { requestWebPage, savePage } from "./helpers";
|
||||
import { logger } from "../logger";
|
||||
import type { QueryDeepPartialEntity } from "typeorm/query-builder/QueryPartialEntity";
|
||||
|
||||
@ -58,7 +58,7 @@ export const getNewRepacksFromCPG = async (
|
||||
|
||||
if (!newRepacks.length) return;
|
||||
|
||||
await saveRepacks(newRepacks);
|
||||
await savePage(newRepacks);
|
||||
|
||||
return getNewRepacksFromCPG(existingRepacks, page + 1);
|
||||
};
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { JSDOM, VirtualConsole } from "jsdom";
|
||||
import { requestWebPage, saveRepacks } from "./helpers";
|
||||
import { requestWebPage, savePage } from "./helpers";
|
||||
import { Repack } from "@main/entity";
|
||||
|
||||
import { QueryDeepPartialEntity } from "typeorm/query-builder/QueryPartialEntity";
|
||||
@ -66,6 +66,6 @@ export const getNewGOGGames = async (existingRepacks: Repack[] = []) => {
|
||||
}
|
||||
}
|
||||
|
||||
if (repacks.length) await saveRepacks(repacks);
|
||||
if (repacks.length) await savePage(repacks);
|
||||
}
|
||||
};
|
||||
|
@ -5,7 +5,7 @@ import { repackRepository } from "@main/repository";
|
||||
|
||||
import { QueryDeepPartialEntity } from "typeorm/query-builder/QueryPartialEntity";
|
||||
|
||||
export const saveRepacks = async (repacks: QueryDeepPartialEntity<Repack>[]) =>
|
||||
export const savePage = async (repacks: QueryDeepPartialEntity<Repack>[]) =>
|
||||
Promise.all(
|
||||
repacks.map((repack) => repackRepository.insert(repack).catch(() => {}))
|
||||
);
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Repack } from "@main/entity";
|
||||
import { decodeNonUtf8Response, saveRepacks } from "./helpers";
|
||||
import { decodeNonUtf8Response, savePage } from "./helpers";
|
||||
import { logger } from "../logger";
|
||||
import parseTorrent, {
|
||||
toMagnetURI,
|
||||
@ -179,7 +179,7 @@ export const getNewRepacksFromOnlineFix = async (
|
||||
if (!newRepacks.length) return;
|
||||
if (page === totalPages) return;
|
||||
|
||||
await saveRepacks(newRepacks);
|
||||
await savePage(newRepacks);
|
||||
|
||||
return getNewRepacksFromOnlineFix(existingRepacks, page + 1, cookieJar);
|
||||
};
|
||||
|
@ -2,7 +2,7 @@ import { JSDOM } from "jsdom";
|
||||
|
||||
import { Repack } from "@main/entity";
|
||||
import { logger } from "../logger";
|
||||
import { requestWebPage, saveRepacks } from "./helpers";
|
||||
import { requestWebPage, savePage } from "./helpers";
|
||||
|
||||
import createWorker from "@main/workers/torrent-parser.worker?nodeWorker";
|
||||
import { toMagnetURI } from "parse-torrent";
|
||||
@ -91,7 +91,7 @@ export const getNewRepacksFromXatab = async (
|
||||
|
||||
if (!newRepacks.length) return;
|
||||
|
||||
await saveRepacks(newRepacks);
|
||||
await savePage(newRepacks);
|
||||
|
||||
return getNewRepacksFromXatab(existingRepacks, page + 1);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user