Skip to content

Commit

Permalink
Revert "Fix TimeSpan overflow in UpdateProgressCRC"
Browse files Browse the repository at this point in the history
This reverts commit a75f61a.
  • Loading branch information
bagusnl committed Dec 25, 2024
1 parent a75f61a commit 8b3a457
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions CollapseLauncher/Classes/Interfaces/Class/ProgressBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -286,17 +286,13 @@ protected virtual void UpdateProgressCRC(long read)
_progress.ProgressAllSpeed = speedAll;

// Calculate the timelapse
_progress.ProgressAllTimeLeft = Math.Min((_progressAllSizeTotal - _progressAllSizeCurrent) /
ConverterTool.Unzeroed(_progress.ProgressAllSpeed),
TimeSpan.MaxValue.TotalSeconds).ToTimeSpanNormalized();
_progress.ProgressAllTimeLeft = ((_progressAllSizeTotal - _progressAllSizeCurrent) / ConverterTool.Unzeroed(_progress.ProgressAllSpeed)).ToTimeSpanNormalized();
}

lock (_status)
{
// Set time estimation string
string timeLeftString = string.Format(Lang!._Misc!.TimeRemainHMSFormat!, ConverterTool.Unzeroed(Math.Min(
_progress.ProgressAllTimeLeft.TotalSeconds,
TimeSpan.MaxValue.Seconds)).ToTimeSpanNormalized());
string timeLeftString = string.Format(Lang!._Misc!.TimeRemainHMSFormat!, _progress.ProgressAllTimeLeft);

// Update current activity status
_status.ActivityPerFile = string.Format(Lang._Misc.Speed!, ConverterTool.SummarizeSizeSimple(_progress.ProgressAllSpeed));
Expand Down

0 comments on commit 8b3a457

Please sign in to comment.