mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-21 01:53:57 +00:00
fix: fixing errors with electron dl manager
This commit is contained in:
35
src/shared/index.ts
Normal file
35
src/shared/index.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
export enum GameStatus {
|
||||
Seeding = "seeding",
|
||||
Downloading = "downloading",
|
||||
Paused = "paused",
|
||||
CheckingFiles = "checking_files",
|
||||
DownloadingMetadata = "downloading_metadata",
|
||||
Cancelled = "cancelled",
|
||||
Finished = "finished",
|
||||
}
|
||||
|
||||
export enum Downloader {
|
||||
Http,
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user