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

View file

@ -1,17 +1,7 @@
import type { Cracker, DownloadSourceStatus, Downloader } from "@shared";
import type { SteamAppDetails } from "./steam.types";
import type { Subscription } from "./level.types";
export type GameStatus =
| "active"
| "waiting"
| "paused"
| "error"
| "complete"
| "seeding"
| "removed";
export type GameShop = "steam" | "epic";
import type { GameShop } from "./game.types";
export type FriendRequestAction = "ACCEPTED" | "REFUSED" | "CANCEL";
@ -32,48 +22,6 @@ export interface GameRepack {
updatedAt: Date;
}
export interface AchievementData {
name: string;
displayName: string;
description?: string;
icon: string;
icongray: string;
hidden: boolean;
points?: number;
}
export interface UserAchievement {
name: string;
hidden: boolean;
displayName: string;
points?: number;
description?: string;
unlocked: boolean;
unlockTime: number | null;
icon: string;
icongray: string;
}
export interface RemoteUnlockedAchievement {
name: string;
hidden: boolean;
icon: string;
displayName: string;
description?: string;
unlockTime: number;
}
export interface GameAchievement {
name: string;
hidden: boolean;
displayName: string;
description?: string;
unlocked: boolean;
unlockTime: number | null;
icon: string;
icongray: string;
}
export type ShopDetails = SteamAppDetails & {
objectId: string;
};
@ -96,40 +44,6 @@ export interface UserGame {
achievementsPointsEarnedSum: number;
}
export interface DownloadQueue {
id: number;
createdAt: Date;
updatedAt: Date;
}
/* Used by the library */
export interface Game {
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;
shouldSeed: boolean;
createdAt: Date;
updatedAt: Date;
}
export type LibraryGame = Omit<Game, "repacks">;
export interface GameRunning {
id?: number;
title: string;
@ -139,24 +53,6 @@ export interface GameRunning {
sessionDurationInMillis: number;
}
export interface DownloadProgress {
downloadSpeed: number;
timeRemaining: number;
numPeers: number;
numSeeds: number;
isDownloadingMetadata: boolean;
isCheckingFiles: boolean;
progress: number;
gameId: number;
game: LibraryGame;
}
export interface SeedingStatus {
gameId: number;
status: GameStatus;
uploadSpeed: number;
}
export interface UserPreferences {
downloadsPath: string | null;
language: string;
@ -344,11 +240,6 @@ export interface UserStats {
unlockedAchievementSum?: number;
}
export interface UnlockedAchievement {
name: string;
unlockTime: number;
}
export interface AchievementFile {
type: Cracker;
filePath: string;
@ -407,9 +298,9 @@ export interface CatalogueSearchPayload {
developers: string[];
}
export * from "./game.types";
export * from "./steam.types";
export * from "./real-debrid.types";
export * from "./download.types";
export * from "./ludusavi.types";
export * from "./how-long-to-beat.types";
export * from "./torbox.types";
export * from "./level.types";