Skip to content

Commit

Permalink
Fix incorrect operator used to calculate speeds when downloading game…
Browse files Browse the repository at this point in the history
…s + build + strings
  • Loading branch information
vapidinfinity committed May 20, 2024
1 parent 7f985cf commit 71f27b3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Mythic.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 2629;
CURRENT_PROJECT_VERSION = 2630;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"Mythic/Preview Content\"";
DEVELOPMENT_TEAM = 67ZBY275P8;
Expand Down Expand Up @@ -914,7 +914,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 2629;
CURRENT_PROJECT_VERSION = 2630;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"Mythic/Preview Content\"";
DEVELOPMENT_TEAM = 67ZBY275P8;
Expand Down
5 changes: 4 additions & 1 deletion Mythic/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -13399,6 +13399,7 @@
}
},
"Error" : {
"extractionState" : "stale",
"localizations" : {
"af" : {
"stringUnit" : {
Expand Down Expand Up @@ -15115,6 +15116,7 @@
}
},
"Failed to load the webpage." : {
"extractionState" : "stale",
"localizations" : {
"af" : {
"stringUnit" : {
Expand Down Expand Up @@ -29999,6 +30001,7 @@
}
},
"Retry" : {
"extractionState" : "stale",
"localizations" : {
"af" : {
"stringUnit" : {
Expand Down Expand Up @@ -39159,4 +39162,4 @@
}
},
"version" : "1.0"
}
}
2 changes: 1 addition & 1 deletion Mythic/Views/Navigation/DownloadsEvo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ struct DownloadCard: View {

if operation.current?.game == game {
HStack {
Text("\(Int(operation.status.progress?.percentage ?? 0))% • ↓ \(Int(operation.status.downloadSpeed?.raw ?? 0.0)) MB/s • ⏲︎ \(operation.status.progress?.eta ?? "00:00:00")")
Text("\(Int(operation.status.progress?.percentage ?? 0))% • ↓ \(Int(operation.status.downloadSpeed?.raw ?? 0.0) * (1000000/1048576)) MB/s • ⏲︎ \(operation.status.progress?.eta ?? "00:00:00")")
.foregroundStyle(.tertiary)
.font({
switch style {
Expand Down
10 changes: 5 additions & 5 deletions Mythic/Views/Sheets/InstallStatus.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ struct InstallStatusView: View {
HStack {
Text("Download Speed:")
Spacer()
Text("\(Int(operation.status.downloadSpeed?.raw ?? 0) * (10^6 / 2^20)) MB/s")
Text("\(Int(operation.status.downloadSpeed?.raw ?? 0) * (1000000/1048576)) MB/s") // using (pow(10, 6) / pow(2, 20)) will resullt in the compiler waving the middle finger at us
Text("(raw)")
.font(.footnote)
.foregroundStyle(.secondary)

VStack {
Text("\(Int(operation.status.download?.downloaded ?? 0) * (10^6 / 2^20)) MB Downloaded")
Text("\(Int(operation.status.download?.written ?? 0) * (10^6 / 2^20)) MB Written")
Text("\(Int(operation.status.download?.downloaded ?? 0) * (1000000/1048576)) MB Downloaded")
Text("\(Int(operation.status.download?.written ?? 0) * (1000000/1048576)) MB Written")
}
.font(.bold(.footnote)())
.foregroundStyle(.secondary)
Expand All @@ -75,12 +75,12 @@ struct InstallStatusView: View {
Text("Disk Speed:")
Spacer()

Text("\(Int(operation.status.diskSpeed?.read ?? 0) * (10^6 / 2^20)) MB/s")
Text("\(Int(operation.status.diskSpeed?.read ?? 0) * (1000000/1048576)) MB/s")
Text("(read)")
.font(.footnote)
.foregroundStyle(.secondary)

Text("\(Int(operation.status.diskSpeed?.write ?? 0) * (10^6 / 2^20)) MB/s")
Text("\(Int(operation.status.diskSpeed?.write ?? 0) * (1000000/1048576)) MB/s")
Text("(write)")
.font(.footnote)
.foregroundStyle(.secondary)
Expand Down

0 comments on commit 71f27b3

Please sign in to comment.