feat: migrating user preferences

This commit is contained in:
Chubby Granny Chaser 2025-01-21 03:48:46 +00:00
parent d760d0139d
commit f1e0ba4dd6
No known key found for this signature in database
53 changed files with 737 additions and 790 deletions

View file

@ -1,5 +1,13 @@
import type { GameStatus } from "./game.types";
import { Game } from "./level.types";
import type { Download } from "./level.types";
export type DownloadStatus =
| "active"
| "waiting"
| "paused"
| "error"
| "complete"
| "seeding"
| "removed";
export interface DownloadProgress {
downloadSpeed: number;
@ -9,8 +17,8 @@ export interface DownloadProgress {
isDownloadingMetadata: boolean;
isCheckingFiles: boolean;
progress: number;
gameId: number;
game: Game;
gameId: string;
download: Download;
}
/* Torbox */
@ -162,7 +170,7 @@ export interface RealDebridUser {
/* Torrent */
export interface SeedingStatus {
gameId: number;
status: GameStatus;
gameId: string;
status: DownloadStatus;
uploadSpeed: number;
}

View file

@ -1,12 +1,3 @@
export type GameStatus =
| "active"
| "waiting"
| "paused"
| "error"
| "complete"
| "seeding"
| "removed";
export type GameShop = "steam" | "epic";
export interface UnlockedAchievement {

View file

@ -1,6 +1,6 @@
import type { Cracker, DownloadSourceStatus, Downloader } from "@shared";
import type { SteamAppDetails } from "./steam.types";
import type { Subscription } from "./level.types";
import type { Download, Game, Subscription } from "./level.types";
import type { GameShop } from "./game.types";
export type FriendRequestAction = "ACCEPTED" | "REFUSED" | "CANCEL";
@ -45,29 +45,13 @@ export interface UserGame {
}
export interface GameRunning {
id?: number;
title: string;
iconUrl: string | null;
objectID: string;
objectId: string;
shop: GameShop;
sessionDurationInMillis: number;
}
export interface UserPreferences {
downloadsPath: string | null;
language: string;
downloadNotificationsEnabled: boolean;
repackUpdatesNotificationsEnabled: boolean;
achievementNotificationsEnabled: boolean;
realDebridApiToken: string | null;
preferQuitInsteadOfHiding: boolean;
runAtStartup: boolean;
startMinimized: boolean;
disableNsfwAlert: boolean;
seedAfterDownloadComplete: boolean;
showHiddenAchievementsDescription: boolean;
}
export interface Steam250Game {
title: string;
objectId: string;
@ -298,6 +282,11 @@ export interface CatalogueSearchPayload {
developers: string[];
}
export interface LibraryGame extends Game {
id: string;
download: Download | null;
}
export * from "./game.types";
export * from "./steam.types";
export * from "./download.types";

View file

@ -1,10 +1,10 @@
import type { Downloader } from "@shared";
import type {
GameShop,
GameStatus,
SteamAchievement,
UnlockedAchievement,
} from "./game.types";
import type { DownloadStatus } from "./download.types";
export type SubscriptionStatus = "active" | "pending" | "cancelled";
@ -48,17 +48,14 @@ export interface Download {
shop: GameShop;
objectId: string;
uri: string;
folderName: string;
folderName: string | null;
downloadPath: string;
progress: number;
downloader: Downloader;
bytesDownloaded: number;
playTimeInMilliseconds: number;
lastTimePlayed: Date | null;
fileSize: number;
fileSize: number | null;
shouldSeed: boolean;
// TODO: Rename to DownloadStatus
status: GameStatus | null;
status: DownloadStatus | null;
timestamp: number;
}
@ -66,3 +63,18 @@ export interface GameAchievement {
achievements: SteamAchievement[];
unlockedAchievements: UnlockedAchievement[];
}
export interface UserPreferences {
downloadsPath: string | null;
language: string;
downloadNotificationsEnabled: boolean;
repackUpdatesNotificationsEnabled: boolean;
achievementNotificationsEnabled: boolean;
realDebridApiToken: string | null;
preferQuitInsteadOfHiding: boolean;
runAtStartup: boolean;
startMinimized: boolean;
disableNsfwAlert: boolean;
seedAfterDownloadComplete: boolean;
showHiddenAchievementsDescription: boolean;
}