mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-15 04:32:13 +00:00
fix: do not notify about the download being ready until the parts are built into the single file.
This commit is contained in:
parent
9cd8188f06
commit
0398164906
1 changed files with 13 additions and 5 deletions
|
@ -47,11 +47,8 @@ export class RealDebridDownloader extends Downloader {
|
|||
|
||||
this.download.on("progress", async ({ total }) => {
|
||||
const updatePayload: QueryDeepPartialEntity<Game> = {
|
||||
status:
|
||||
total.percentage === 100
|
||||
? GameStatus.Finished
|
||||
: GameStatus.Downloading,
|
||||
progress: total.percentage / 100,
|
||||
status: GameStatus.Downloading,
|
||||
progress: Math.min(0.99, total.percentage / 100),
|
||||
bytesDownloaded: total.bytes,
|
||||
};
|
||||
|
||||
|
@ -62,6 +59,17 @@ export class RealDebridDownloader extends Downloader {
|
|||
|
||||
await this.updateGameProgress(game.id, updatePayload, downloadStatus);
|
||||
});
|
||||
|
||||
this.download.on("end", async () => {
|
||||
const updatePayload: QueryDeepPartialEntity<Game> = {
|
||||
status: GameStatus.Finished,
|
||||
progress: 1,
|
||||
};
|
||||
|
||||
await this.updateGameProgress(game.id, updatePayload, {
|
||||
timeRemaining: 0,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
static destroy() {
|
||||
|
|
Loading…
Reference in a new issue