feat: optimizations

This commit is contained in:
Zamitto
2025-06-26 19:37:28 -03:00
parent cb758cceda
commit bf8fd0dacf
14 changed files with 46 additions and 51 deletions

View File

@@ -0,0 +1,11 @@
import type { GameStats } from "@types";
import { db } from "../level";
import { levelKeys } from "./keys";
export const gamesStatsCacheSublevel = db.sublevel<
string,
GameStats & { updatedAt: number }
>(levelKeys.gameStatsCache, {
valueEncoding: "json",
});

View File

@@ -2,6 +2,7 @@ export * from "./downloads";
export * from "./games";
export * from "./game-shop-assets";
export * from "./game-shop-cache";
export * from "./game-stats-cache";
export * from "./game-achievements";
export * from "./keys";
export * from "./themes";

View File

@@ -7,6 +7,7 @@ export const levelKeys = {
auth: "auth",
themes: "themes",
gameShopAssets: "gameShopAssets",
gameStatsCache: "gameStatsAssets",
gameShopCache: "gameShopCache",
gameShopCacheItem: (shop: GameShop, objectId: string, language: string) =>
`${shop}:${objectId}:${language}`,