Fix downloaded size being incorrectly reported

This commit is contained in:
Xpl0itU 2024-04-16 15:26:43 +02:00
parent e5c555c2a7
commit a6ccbb2473
2 changed files with 5 additions and 3 deletions

View file

@ -35,7 +35,7 @@ type ProgressReporter interface {
Cancelled() bool
SetCancelled()
SetDownloadSize(size int64)
ResetTotalDownloaded()
ResetTotals()
MarkFileAsDone(filename string)
SetTotalDownloadedForFile(filename string, downloaded int64)
SetStartTime(startTime time.Time)
@ -161,7 +161,7 @@ func downloadFile(progressReporter ProgressReporter, client *http.Client, downlo
func DownloadTitle(titleID, outputDirectory string, doDecryption bool, progressReporter ProgressReporter, deleteEncryptedContents bool, client *http.Client) error {
tEntry := getTitleEntryFromTid(titleID)
progressReporter.ResetTotalDownloaded()
progressReporter.ResetTotals()
progressReporter.SetGameTitle(tEntry.Name)
outputDir := strings.TrimRight(outputDirectory, "/\\")