mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-11 13:56:16 +00:00
refactor: adjust file size handling in DownloadManager to ensure accurate download status updates
This commit is contained in:
@@ -156,10 +156,13 @@ export class DownloadManager {
|
|||||||
const { progress, downloadSpeed, bytesDownloaded, fileSize, folderName } =
|
const { progress, downloadSpeed, bytesDownloaded, fileSize, folderName } =
|
||||||
status;
|
status;
|
||||||
|
|
||||||
|
const finalFileSize =
|
||||||
|
fileSize && fileSize > 0 ? fileSize : download.fileSize;
|
||||||
|
|
||||||
const updatedDownload = {
|
const updatedDownload = {
|
||||||
...download,
|
...download,
|
||||||
bytesDownloaded,
|
bytesDownloaded,
|
||||||
fileSize,
|
fileSize: finalFileSize,
|
||||||
progress,
|
progress,
|
||||||
folderName,
|
folderName,
|
||||||
status:
|
status:
|
||||||
@@ -176,7 +179,11 @@ export class DownloadManager {
|
|||||||
numPeers: 0,
|
numPeers: 0,
|
||||||
numSeeds: 0,
|
numSeeds: 0,
|
||||||
downloadSpeed,
|
downloadSpeed,
|
||||||
timeRemaining: calculateETA(fileSize, bytesDownloaded, downloadSpeed),
|
timeRemaining: calculateETA(
|
||||||
|
finalFileSize ?? 0,
|
||||||
|
bytesDownloaded,
|
||||||
|
downloadSpeed
|
||||||
|
),
|
||||||
isDownloadingMetadata: false,
|
isDownloadingMetadata: false,
|
||||||
isCheckingFiles: false,
|
isCheckingFiles: false,
|
||||||
progress,
|
progress,
|
||||||
|
|||||||
Reference in New Issue
Block a user