2024-05-05 21:18:48 +03:00
|
|
|
export enum GameStatus {
|
|
|
|
Seeding = "seeding",
|
|
|
|
Downloading = "downloading",
|
|
|
|
Paused = "paused",
|
|
|
|
CheckingFiles = "checking_files",
|
|
|
|
DownloadingMetadata = "downloading_metadata",
|
|
|
|
Cancelled = "cancelled",
|
2024-05-06 12:25:13 +03:00
|
|
|
Decompressing = "decompressing",
|
2024-05-05 21:18:48 +03:00
|
|
|
Finished = "finished",
|
|
|
|
}
|
|
|
|
|
|
|
|
export enum Downloader {
|
2024-05-06 11:53:18 +03:00
|
|
|
RealDebrid,
|
2024-05-05 21:18:48 +03:00
|
|
|
Torrent,
|
|
|
|
}
|
|
|
|
|
|
|
|
export class GameStatusHelper {
|
|
|
|
public static isDownloading(status: GameStatus | null) {
|
|
|
|
return (
|
|
|
|
status === GameStatus.Downloading ||
|
|
|
|
status === GameStatus.DownloadingMetadata ||
|
|
|
|
status === GameStatus.CheckingFiles
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static isVerifying(status: GameStatus | null) {
|
|
|
|
return (
|
|
|
|
GameStatus.DownloadingMetadata == status ||
|
|
|
|
GameStatus.CheckingFiles == status
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static isReady(status: GameStatus | null) {
|
|
|
|
return status === GameStatus.Finished || status === GameStatus.Seeding;
|
|
|
|
}
|
|
|
|
}
|