mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-28 21:31:03 +00:00
feat: migrating achievements to level
This commit is contained in:
11
src/main/level/sublevels/game-achievements.ts
Normal file
11
src/main/level/sublevels/game-achievements.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import type { GameAchievement } from "@types";
|
||||
|
||||
import { db } from "../level";
|
||||
import { levelKeys } from "./keys";
|
||||
|
||||
export const gameAchievementsSublevel = db.sublevel<string, GameAchievement>(
|
||||
levelKeys.gameAchievements,
|
||||
{
|
||||
valueEncoding: "json",
|
||||
}
|
||||
);
|
||||
11
src/main/level/sublevels/game-shop-cache.ts
Normal file
11
src/main/level/sublevels/game-shop-cache.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import type { ShopDetails } from "@types";
|
||||
|
||||
import { db } from "../level";
|
||||
import { levelKeys } from "./keys";
|
||||
|
||||
export const gamesShopCacheSublevel = db.sublevel<string, ShopDetails>(
|
||||
levelKeys.gameShopCache,
|
||||
{
|
||||
valueEncoding: "json",
|
||||
}
|
||||
);
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Game } from "@types";
|
||||
import type { Game } from "@types";
|
||||
|
||||
import { db } from "../level";
|
||||
import { levelKeys } from "./keys";
|
||||
|
||||
|
||||
@@ -1 +1,5 @@
|
||||
export * from "./games";
|
||||
export * from "./game-shop-cache";
|
||||
export * from "./game-achievements";
|
||||
|
||||
export * from "./keys";
|
||||
|
||||
@@ -5,4 +5,8 @@ export const levelKeys = {
|
||||
game: (shop: GameShop, objectId: string) => `${shop}:${objectId}`,
|
||||
user: "user",
|
||||
auth: "auth",
|
||||
gameShopCache: "gameShopCache",
|
||||
gameShopCacheItem: (shop: GameShop, objectId: string, language: string) =>
|
||||
`${shop}:${objectId}:${language}`,
|
||||
gameAchievements: "gameAchievements",
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user