Merge branch 'feat/migration-to-leveldb' into feature/torbox-integration

# Conflicts:
#	src/locales/en/translation.json
#	src/locales/pt-BR/translation.json
#	src/main/entity/user-preferences.entity.ts
#	src/main/events/auth/sign-out.ts
#	src/main/knex-client.ts
#	src/main/main.ts
#	src/main/services/download/download-manager.ts
#	src/main/services/process-watcher.ts
#	src/renderer/src/pages/downloads/download-group.tsx
#	src/types/index.ts
#	src/types/torbox.types.ts
This commit is contained in:
Zamitto 2025-02-01 15:43:32 -03:00
commit 3d571edccb
161 changed files with 2590 additions and 2802 deletions

View file

@ -1,16 +1,7 @@
import type { Cracker, DownloadSourceStatus, Downloader } from "@shared";
import type { SteamAppDetails } from "./steam.types";
export type GameStatus =
| "active"
| "waiting"
| "paused"
| "error"
| "complete"
| "seeding"
| "removed";
export type GameShop = "steam" | "epic";
import type { Download, Game, Subscription } from "./level.types";
import type { GameShop } from "./game.types";
export type FriendRequestAction = "ACCEPTED" | "REFUSED" | "CANCEL";
@ -33,48 +24,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;
};
@ -97,45 +46,11 @@ 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;
id: string;
title: string;
iconUrl: string | null;
objectID: string;
objectId: string;
shop: GameShop;
sessionDurationInMillis: number;
}
@ -251,16 +166,6 @@ export interface UserProfileCurrentGame extends Omit<GameRunning, "objectId"> {
export type ProfileVisibility = "PUBLIC" | "PRIVATE" | "FRIENDS";
export type SubscriptionStatus = "active" | "pending" | "cancelled";
export interface Subscription {
id: string;
status: SubscriptionStatus;
plan: { id: string; name: string };
expiresAt: string | null;
paymentMethod: "pix" | "paypal";
}
export interface UserDetails {
id: string;
username: string;
@ -270,6 +175,7 @@ export interface UserDetails {
backgroundImageUrl: string | null;
profileVisibility: ProfileVisibility;
bio: string;
featurebaseJwt: string;
subscription: Subscription | null;
quirks?: {
backupsPerGameLimit: number;
@ -302,6 +208,7 @@ export interface UpdateProfileRequest {
profileImageUrl?: string | null;
backgroundImageUrl?: string | null;
bio?: string;
language?: string;
}
export interface DownloadSourceDownload {
@ -356,11 +263,6 @@ export interface UserStats {
unlockedAchievementSum?: number;
}
export interface UnlockedAchievement {
name: string;
unlockTime: number;
}
export interface AchievementFile {
type: Cracker;
filePath: string;
@ -419,8 +321,14 @@ 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 "./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";