From 81a0fc9edf90f168f0f9a202277303502d4161f8 Mon Sep 17 00:00:00 2001 From: Mircea Roata Date: Fri, 29 Dec 2023 23:39:55 +0200 Subject: [PATCH] =?UTF-8?q?Add=20ficsit=20guarantee=E2=84=A2=20for=20ETAs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/bindings/ficsitcli/process.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/backend/bindings/ficsitcli/process.go b/backend/bindings/ficsitcli/process.go index b75f59ca..71809a68 100644 --- a/backend/bindings/ficsitcli/process.go +++ b/backend/bindings/ficsitcli/process.go @@ -86,6 +86,11 @@ func (f *FicsitCLI) validateInstall(installation *InstallationInfo, progressItem if hasDownloading { if downloadBytesProgress.Total != 0 { + eta := downloadProgressTracker.ETA().Round(time.Second) + etaText := eta.String() + if eta == 0 { + etaText = "soon™" + } f.setProgress(&Progress{ Item: progressItem, Message: fmt.Sprintf( @@ -93,13 +98,18 @@ func (f *FicsitCLI) validateInstall(installation *InstallationInfo, progressItem downloadModsProgress.Completed, downloadModsProgress.Total, humanize.Bytes(uint64(downloadBytesProgress.Completed)), humanize.Bytes(uint64(downloadBytesProgress.Total)), humanize.Bytes(uint64(downloadProgressTracker.Speed())), - downloadProgressTracker.ETA().Round(time.Second), + etaText, ), Progress: downloadBytesProgress.Percentage(), }) } } else { if extractBytesProgress.Total != 0 { + eta := extractProgressTracker.ETA().Round(time.Second) + etaText := eta.String() + if eta == 0 { + etaText = "soon™" + } f.setProgress(&Progress{ Item: progressItem, Message: fmt.Sprintf( @@ -107,7 +117,7 @@ func (f *FicsitCLI) validateInstall(installation *InstallationInfo, progressItem extractModsProgress.Completed, extractModsProgress.Total, humanize.Bytes(uint64(extractBytesProgress.Completed)), humanize.Bytes(uint64(extractBytesProgress.Total)), humanize.Bytes(uint64(extractProgressTracker.Speed())), - extractProgressTracker.ETA().Round(time.Second), + etaText, ), Progress: extractBytesProgress.Percentage(), })