mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-18 00:33:59 +00:00
feat: improving caching
This commit is contained in:
@@ -15,11 +15,9 @@ const addDownloadSource = async (
|
||||
// Verify that repacks were actually written to the database (read-after-write)
|
||||
// This ensures all async operations are complete before proceeding
|
||||
let repackCount = 0;
|
||||
const repackIds: number[] = [];
|
||||
for await (const [, repack] of repacksSublevel.iterator()) {
|
||||
if (repack.downloadSourceId === result.id) {
|
||||
repackCount++;
|
||||
repackIds.push(repack.id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import axios from "axios";
|
||||
import { z } from "zod";
|
||||
import { downloadSourcesSublevel, repacksSublevel } from "@main/level";
|
||||
import { DownloadSourceStatus } from "@shared";
|
||||
import crypto from "crypto";
|
||||
import crypto from "node:crypto";
|
||||
import { logger, ResourceCache } from "@main/services";
|
||||
|
||||
export const downloadSourceSchema = z.object({
|
||||
@@ -62,9 +62,9 @@ export type FormattedSteamGamesByLetter = Record<string, FormattedSteamGame[]>;
|
||||
export const formatName = (name: string) => {
|
||||
return name
|
||||
.normalize("NFD")
|
||||
.replace(/[\u0300-\u036f]/g, "")
|
||||
.replaceAll(/[\u0300-\u036f]/g, "")
|
||||
.toLowerCase()
|
||||
.replace(/[^a-z0-9]/g, "");
|
||||
.replaceAll(/[^a-z0-9]/g, "");
|
||||
};
|
||||
|
||||
export const formatRepackName = (name: string) => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { registerEvent } from "../register-event";
|
||||
import { gamesSublevel, gamesShopAssetsSublevel, levelKeys } from "@main/level";
|
||||
import { randomUUID } from "crypto";
|
||||
import { randomUUID } from "node:crypto";
|
||||
import type { GameShop } from "@types";
|
||||
|
||||
const addCustomGameToLibrary = async (
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { registerEvent } from "../register-event";
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { randomUUID } from "crypto";
|
||||
import { randomUUID } from "node:crypto";
|
||||
import { ASSETS_PATH } from "@main/constants";
|
||||
|
||||
const copyCustomGameAsset = async (
|
||||
|
||||
Reference in New Issue
Block a user