feat: migrating games to leveldb

This commit is contained in:
Chubby Granny Chaser 2025-01-19 17:59:39 +00:00
parent c115040e90
commit 1f0e195854
No known key found for this signature in database
34 changed files with 410 additions and 343 deletions

View file

@ -1,4 +1,5 @@
import type { Game, GameStatus } from "./game.types";
import type { GameStatus } from "./game.types";
import { Game } from "./level.types";
export interface DownloadProgress {
downloadSpeed: number;

View file

@ -1,5 +1,3 @@
import type { Downloader } from "@shared";
export type GameStatus =
| "active"
| "waiting"
@ -11,33 +9,6 @@ export type GameStatus =
export type GameShop = "steam" | "epic";
export interface Game {
// TODO: To be depreacted
id: number;
title: string;
iconUrl: string;
status: GameStatus | null;
folderName: string;
downloadPath: string | null;
progress: number;
bytesDownloaded: number;
playTimeInMilliseconds: number;
downloader: Downloader;
winePrefixPath: string | null;
executablePath: string | null;
launchOptions: string | null;
lastTimePlayed: Date | null;
uri: string | null;
fileSize: number;
objectID: string;
shop: GameShop;
// downloadQueue: DownloadQueue | null;
downloadQueue: any | null;
shouldSeed: boolean;
createdAt: Date;
updatedAt: Date;
}
export interface UnlockedAchievement {
name: string;
unlockTime: number;

View file

@ -1,4 +1,10 @@
import type { SteamAchievement, UnlockedAchievement } from "./game.types";
import type { Downloader } from "@shared";
import type {
GameShop,
GameStatus,
SteamAchievement,
UnlockedAchievement,
} from "./game.types";
export type SubscriptionStatus = "active" | "pending" | "cancelled";
@ -24,6 +30,37 @@ export interface User {
subscription: Subscription | null;
}
export interface Game {
title: string;
iconUrl: string | null;
status: GameStatus | null;
playTimeInMilliseconds: number;
lastTimePlayed: Date | null;
objectId: string;
shop: GameShop;
remoteId: string | null;
isDeleted: boolean;
winePrefixPath?: string | null;
executablePath?: string | null;
launchOptions?: string | null;
}
export interface Download {
shop: GameShop;
objectId: string;
uri: string;
folderName: string;
downloadPath: string;
progress: number;
downloader: Downloader;
bytesDownloaded: number;
playTimeInMilliseconds: number;
lastTimePlayed: Date | null;
fileSize: number;
shouldSeed: boolean;
timestamp: number;
}
export interface GameAchievement {
achievements: SteamAchievement[];
unlockedAchievements: UnlockedAchievement[];