2024-06-03 20:39:37 +00:00
|
|
|
import type { DownloadSourceStatus, Downloader } from "@shared";
|
2024-04-29 18:50:10 +00:00
|
|
|
|
2024-06-27 13:55:50 +00:00
|
|
|
export type GameStatus =
|
|
|
|
| "active"
|
|
|
|
| "waiting"
|
|
|
|
| "paused"
|
|
|
|
| "error"
|
|
|
|
| "complete"
|
|
|
|
| "removed";
|
|
|
|
|
2024-04-18 07:46:06 +00:00
|
|
|
export type GameShop = "steam" | "epic";
|
|
|
|
|
|
|
|
export interface SteamGenre {
|
|
|
|
id: string;
|
|
|
|
name: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface SteamScreenshot {
|
|
|
|
id: number;
|
|
|
|
path_thumbnail: string;
|
|
|
|
path_full: string;
|
|
|
|
}
|
|
|
|
|
2024-05-05 02:37:47 +00:00
|
|
|
export interface SteamVideoSource {
|
|
|
|
max: string;
|
2024-05-07 14:42:09 +00:00
|
|
|
"480": string;
|
2024-05-05 02:37:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface SteamMovies {
|
|
|
|
id: number;
|
|
|
|
mp4: SteamVideoSource;
|
|
|
|
webm: SteamVideoSource;
|
|
|
|
thumbnail: string;
|
|
|
|
name: string;
|
|
|
|
highlight: boolean;
|
|
|
|
}
|
|
|
|
|
2024-04-18 07:46:06 +00:00
|
|
|
export interface SteamAppDetails {
|
|
|
|
name: string;
|
|
|
|
detailed_description: string;
|
|
|
|
about_the_game: string;
|
|
|
|
short_description: string;
|
|
|
|
publishers: string[];
|
|
|
|
genres: SteamGenre[];
|
2024-05-07 14:42:09 +00:00
|
|
|
movies?: SteamMovies[];
|
2024-06-03 19:56:21 +00:00
|
|
|
screenshots?: SteamScreenshot[];
|
2024-04-18 07:46:06 +00:00
|
|
|
pc_requirements: {
|
|
|
|
minimum: string;
|
|
|
|
recommended: string;
|
|
|
|
};
|
|
|
|
mac_requirements: {
|
|
|
|
minimum: string;
|
|
|
|
recommended: string;
|
|
|
|
};
|
2024-05-05 18:50:17 +00:00
|
|
|
linux_requirements: {
|
2024-04-18 07:46:06 +00:00
|
|
|
minimum: string;
|
|
|
|
recommended: string;
|
|
|
|
};
|
|
|
|
release_date: {
|
|
|
|
coming_soon: boolean;
|
|
|
|
date: string;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface GameRepack {
|
|
|
|
id: number;
|
|
|
|
title: string;
|
|
|
|
magnet: string;
|
|
|
|
repacker: string;
|
|
|
|
fileSize: string | null;
|
|
|
|
uploadDate: Date | string | null;
|
|
|
|
createdAt: Date;
|
|
|
|
updatedAt: Date;
|
|
|
|
}
|
|
|
|
|
2024-04-28 18:21:14 +00:00
|
|
|
export type ShopDetails = SteamAppDetails & {
|
|
|
|
objectID: string;
|
|
|
|
};
|
|
|
|
|
2024-04-18 07:46:06 +00:00
|
|
|
export interface TorrentFile {
|
|
|
|
path: string;
|
|
|
|
length: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Used by the catalogue */
|
|
|
|
export interface CatalogueEntry {
|
|
|
|
objectID: string;
|
|
|
|
shop: GameShop;
|
|
|
|
title: string;
|
|
|
|
/* Epic Games covers cannot be guessed with objectID */
|
|
|
|
cover: string;
|
|
|
|
repacks: GameRepack[];
|
|
|
|
}
|
|
|
|
|
2024-06-16 21:39:28 +00:00
|
|
|
export interface UserGame {
|
2024-06-13 03:39:11 +00:00
|
|
|
objectID: string;
|
|
|
|
shop: GameShop;
|
|
|
|
title: string;
|
2024-06-14 18:08:35 +00:00
|
|
|
iconUrl: string | null;
|
|
|
|
cover: string;
|
2024-06-14 17:46:30 +00:00
|
|
|
playTimeInSeconds: number;
|
|
|
|
lastTimePlayed: Date | null;
|
2024-06-13 03:39:11 +00:00
|
|
|
}
|
|
|
|
|
2024-06-04 14:33:47 +00:00
|
|
|
export interface DownloadQueue {
|
|
|
|
id: number;
|
|
|
|
createdAt: Date;
|
|
|
|
updatedAt: Date;
|
|
|
|
}
|
|
|
|
|
2024-04-18 07:46:06 +00:00
|
|
|
/* Used by the library */
|
2024-06-03 15:43:49 +00:00
|
|
|
export interface Game {
|
2024-04-18 07:46:06 +00:00
|
|
|
id: number;
|
|
|
|
title: string;
|
|
|
|
iconUrl: string;
|
2024-06-27 13:55:50 +00:00
|
|
|
status: GameStatus | null;
|
2024-04-18 07:46:06 +00:00
|
|
|
folderName: string;
|
|
|
|
downloadPath: string | null;
|
|
|
|
repacks: GameRepack[];
|
|
|
|
progress: number;
|
|
|
|
bytesDownloaded: number;
|
|
|
|
playTimeInMilliseconds: number;
|
2024-05-05 18:18:48 +00:00
|
|
|
downloader: Downloader;
|
2024-04-18 07:46:06 +00:00
|
|
|
executablePath: string | null;
|
|
|
|
lastTimePlayed: Date | null;
|
2024-06-08 18:18:24 +00:00
|
|
|
uri: string | null;
|
2024-04-18 07:46:06 +00:00
|
|
|
fileSize: number;
|
2024-06-03 15:43:49 +00:00
|
|
|
objectID: string;
|
|
|
|
shop: GameShop;
|
2024-06-04 14:33:47 +00:00
|
|
|
downloadQueue: DownloadQueue | null;
|
2024-04-18 07:46:06 +00:00
|
|
|
createdAt: Date;
|
|
|
|
updatedAt: Date;
|
|
|
|
}
|
|
|
|
|
2024-06-03 15:43:49 +00:00
|
|
|
export type LibraryGame = Omit<Game, "repacks">;
|
|
|
|
|
2024-06-20 21:09:49 +00:00
|
|
|
export interface GameRunning {
|
2024-06-20 01:05:22 +00:00
|
|
|
id: number;
|
2024-06-19 22:07:36 +00:00
|
|
|
title: string;
|
|
|
|
iconUrl: string;
|
|
|
|
objectID: string;
|
|
|
|
shop: GameShop;
|
2024-06-20 14:27:09 +00:00
|
|
|
sessionDurationInMillis: number;
|
2024-06-19 22:07:36 +00:00
|
|
|
}
|
|
|
|
|
2024-05-20 01:21:11 +00:00
|
|
|
export interface DownloadProgress {
|
2024-04-18 07:46:06 +00:00
|
|
|
downloadSpeed: number;
|
|
|
|
timeRemaining: number;
|
|
|
|
numPeers: number;
|
|
|
|
numSeeds: number;
|
2024-05-28 13:01:28 +00:00
|
|
|
isDownloadingMetadata: boolean;
|
2024-06-27 16:18:48 +00:00
|
|
|
isCheckingFiles: boolean;
|
|
|
|
progress: number;
|
|
|
|
gameId: number;
|
2024-06-03 15:43:49 +00:00
|
|
|
game: LibraryGame;
|
2024-04-18 07:46:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface UserPreferences {
|
|
|
|
downloadsPath: string | null;
|
|
|
|
language: string;
|
|
|
|
downloadNotificationsEnabled: boolean;
|
|
|
|
repackUpdatesNotificationsEnabled: boolean;
|
2024-04-29 18:52:53 +00:00
|
|
|
realDebridApiToken: string | null;
|
2024-05-03 17:58:45 +00:00
|
|
|
preferQuitInsteadOfHiding: boolean;
|
2024-05-05 23:11:12 +00:00
|
|
|
runAtStartup: boolean;
|
2024-04-18 07:46:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface HowLongToBeatCategory {
|
|
|
|
title: string;
|
|
|
|
duration: string;
|
|
|
|
accuracy: string;
|
|
|
|
}
|
2024-05-13 08:35:29 +00:00
|
|
|
|
|
|
|
export interface Steam250Game {
|
|
|
|
title: string;
|
|
|
|
objectID: string;
|
|
|
|
}
|
2024-05-18 20:55:12 +00:00
|
|
|
|
|
|
|
export interface SteamGame {
|
|
|
|
id: number;
|
|
|
|
name: string;
|
|
|
|
clientIcon: string | null;
|
|
|
|
}
|
2024-05-19 04:39:50 +00:00
|
|
|
|
2024-05-23 23:26:21 +00:00
|
|
|
export type AppUpdaterEvent =
|
2024-06-02 05:21:03 +00:00
|
|
|
| { type: "update-available"; info: { version: string } }
|
|
|
|
| { type: "update-downloaded" };
|
2024-05-23 23:26:21 +00:00
|
|
|
|
|
|
|
/* Events */
|
|
|
|
export interface StartGameDownloadPayload {
|
|
|
|
repackId: number;
|
|
|
|
objectID: string;
|
|
|
|
title: string;
|
|
|
|
shop: GameShop;
|
|
|
|
downloadPath: string;
|
|
|
|
downloader: Downloader;
|
|
|
|
}
|
2024-05-28 13:01:28 +00:00
|
|
|
|
|
|
|
export interface RealDebridUnrestrictLink {
|
|
|
|
id: string;
|
|
|
|
filename: string;
|
|
|
|
mimeType: string;
|
|
|
|
filesize: number;
|
|
|
|
link: string;
|
|
|
|
host: string;
|
|
|
|
host_icon: string;
|
|
|
|
chunks: number;
|
|
|
|
crc: number;
|
|
|
|
download: string;
|
|
|
|
streamable: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface RealDebridAddMagnet {
|
|
|
|
id: string;
|
|
|
|
// URL of the created ressource
|
|
|
|
uri: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface RealDebridTorrentInfo {
|
|
|
|
id: string;
|
|
|
|
filename: string;
|
|
|
|
original_filename: string;
|
|
|
|
hash: string;
|
|
|
|
bytes: number;
|
|
|
|
original_bytes: number;
|
|
|
|
host: string;
|
|
|
|
split: number;
|
|
|
|
progress: number;
|
2024-05-29 15:22:30 +00:00
|
|
|
status:
|
|
|
|
| "magnet_error"
|
|
|
|
| "magnet_conversion"
|
|
|
|
| "waiting_files_selection"
|
|
|
|
| "queued"
|
|
|
|
| "downloading"
|
|
|
|
| "downloaded"
|
|
|
|
| "error"
|
|
|
|
| "virus"
|
|
|
|
| "compressing"
|
|
|
|
| "uploading"
|
|
|
|
| "dead";
|
2024-05-28 13:01:28 +00:00
|
|
|
added: string;
|
|
|
|
files: {
|
|
|
|
id: number;
|
|
|
|
path: string;
|
|
|
|
bytes: number;
|
|
|
|
selected: number;
|
|
|
|
}[];
|
|
|
|
links: string[];
|
|
|
|
ended: string;
|
|
|
|
speed: number;
|
|
|
|
seeders: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface RealDebridUser {
|
|
|
|
id: number;
|
|
|
|
username: string;
|
|
|
|
email: string;
|
|
|
|
points: number;
|
|
|
|
locale: string;
|
|
|
|
avatar: string;
|
|
|
|
type: string;
|
|
|
|
premium: number;
|
|
|
|
expiration: string;
|
|
|
|
}
|
2024-06-03 01:12:05 +00:00
|
|
|
|
2024-06-17 23:09:26 +00:00
|
|
|
export interface UserDetails {
|
2024-06-16 16:58:24 +00:00
|
|
|
id: string;
|
|
|
|
displayName: string;
|
|
|
|
profileImageUrl: string | null;
|
|
|
|
}
|
|
|
|
|
2024-06-12 01:09:24 +00:00
|
|
|
export interface UserProfile {
|
2024-06-15 22:52:37 +00:00
|
|
|
id: string;
|
2024-06-13 23:02:41 +00:00
|
|
|
displayName: string;
|
2024-06-28 19:27:22 +00:00
|
|
|
username: string;
|
2024-06-14 21:23:57 +00:00
|
|
|
profileImageUrl: string | null;
|
2024-06-22 04:47:20 +00:00
|
|
|
totalPlayTimeInSeconds: number;
|
2024-06-16 21:39:28 +00:00
|
|
|
libraryGames: UserGame[];
|
|
|
|
recentGames: UserGame[];
|
2024-06-12 01:09:24 +00:00
|
|
|
}
|
|
|
|
|
2024-06-03 01:12:05 +00:00
|
|
|
export interface DownloadSource {
|
|
|
|
id: number;
|
|
|
|
name: string;
|
|
|
|
url: string;
|
|
|
|
repackCount: number;
|
2024-06-03 20:39:37 +00:00
|
|
|
status: DownloadSourceStatus;
|
2024-06-05 13:18:40 +00:00
|
|
|
downloadCount: number;
|
2024-06-03 20:39:37 +00:00
|
|
|
etag: string | null;
|
2024-06-03 01:12:05 +00:00
|
|
|
createdAt: Date;
|
|
|
|
updatedAt: Date;
|
|
|
|
}
|