mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
fix: fixing errors with electron dl manager
This commit is contained in:
parent
11f1785432
commit
74a99f5bc8
51 changed files with 718 additions and 766 deletions
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;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue