Skip to content

Commit

Permalink
Fix modpack download speed
Browse files Browse the repository at this point in the history
  • Loading branch information
mrquantumoff committed Feb 17, 2023
1 parent 5945d7c commit 7a76cde
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions lib/backend.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,12 @@ Future<void> installModpack(
chunks.addAll(newBytes);
final downloadedLength = chunks.length;
DateTime contentDownloadTime = DateTime.now();
double dlSpeed = double.parse(((chunks.length /
contentDownloadTime
.difference(startContentDownloadTime)
.inSeconds) /
1000000 *
0.875)
.toStringAsFixed(2));
double dlSpeed = ((chunks.length /
contentDownloadTime
.difference(startContentDownloadTime)
.inSeconds) /
1000000 *
0.875);
setDownloadSpeed(dlSpeed);
setProgressValue(downloadedLength.toDouble() / contentLength);
}).onDone(() async {
Expand Down

0 comments on commit 7a76cde

Please sign in to comment.