From 8c13a31536994ad8109e583f9e936cfcd95cce9d Mon Sep 17 00:00:00 2001 From: RoguedBear Date: Sun, 5 Jan 2025 01:35:44 +0530 Subject: [PATCH] for updates, calculate percentage based w/o including cache --- src/backend/storeManagers/legendary/games.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/backend/storeManagers/legendary/games.ts b/src/backend/storeManagers/legendary/games.ts index e879d197ba..33e2addef0 100644 --- a/src/backend/storeManagers/legendary/games.ts +++ b/src/backend/storeManagers/legendary/games.ts @@ -467,8 +467,14 @@ export function onInstallOrUpdateOutput( const downloaded = parseFloat(progress.bytes) const downloadCache = totalDownloadSize - currentDownloadSize[appName] const totalDownloaded = downloaded + downloadCache - const newPercent = - Math.round((totalDownloaded / totalDownloadSize) * 10000) / 100 + let newPercent: number + if (action === 'installing') { + newPercent = + Math.round((totalDownloaded / totalDownloadSize) * 10000) / 100 + } else { + newPercent = + Math.round((downloaded / currentDownloadSize[appName]) * 10000) / 100 + } progress.percent = newPercent >= 0 ? newPercent : undefined }