feat: migrating achievements to level

This commit is contained in:
Chubby Granny Chaser 2025-01-16 02:30:09 +00:00
parent 2c881a6100
commit a23106b0b1
No known key found for this signature in database
34 changed files with 388 additions and 475 deletions

59
src/types/game.types.ts Normal file
View file

@ -0,0 +1,59 @@
import type { Downloader } from "@shared";
export type GameStatus =
| "active"
| "waiting"
| "paused"
| "error"
| "complete"
| "seeding"
| "removed";
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;
}
export interface SteamAchievement {
name: string;
displayName: string;
description?: string;
icon: string;
icongray: string;
hidden: boolean;
points?: number;
}
export interface UserAchievement extends SteamAchievement {
unlocked: boolean;
unlockTime: number | null;
}