From 71f27b3b61492385b6a0be97bc7568d866ce2b64 Mon Sep 17 00:00:00 2001 From: blackxfiied <41133734+blackxfiied@users.noreply.github.com> Date: Mon, 20 May 2024 21:52:57 +0800 Subject: [PATCH] Fix incorrect operator used to calculate speeds when downloading games + build + strings --- Mythic.xcodeproj/project.pbxproj | 4 ++-- Mythic/Localizable.xcstrings | 5 ++++- Mythic/Views/Navigation/DownloadsEvo.swift | 2 +- Mythic/Views/Sheets/InstallStatus.swift | 10 +++++----- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Mythic.xcodeproj/project.pbxproj b/Mythic.xcodeproj/project.pbxproj index 874a19de..8090b219 100644 --- a/Mythic.xcodeproj/project.pbxproj +++ b/Mythic.xcodeproj/project.pbxproj @@ -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; @@ -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; diff --git a/Mythic/Localizable.xcstrings b/Mythic/Localizable.xcstrings index 02828724..0e5bebe7 100644 --- a/Mythic/Localizable.xcstrings +++ b/Mythic/Localizable.xcstrings @@ -13399,6 +13399,7 @@ } }, "Error" : { + "extractionState" : "stale", "localizations" : { "af" : { "stringUnit" : { @@ -15115,6 +15116,7 @@ } }, "Failed to load the webpage." : { + "extractionState" : "stale", "localizations" : { "af" : { "stringUnit" : { @@ -29999,6 +30001,7 @@ } }, "Retry" : { + "extractionState" : "stale", "localizations" : { "af" : { "stringUnit" : { @@ -39159,4 +39162,4 @@ } }, "version" : "1.0" -} \ No newline at end of file +} diff --git a/Mythic/Views/Navigation/DownloadsEvo.swift b/Mythic/Views/Navigation/DownloadsEvo.swift index 3dbc65ae..f516bb83 100644 --- a/Mythic/Views/Navigation/DownloadsEvo.swift +++ b/Mythic/Views/Navigation/DownloadsEvo.swift @@ -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 { diff --git a/Mythic/Views/Sheets/InstallStatus.swift b/Mythic/Views/Sheets/InstallStatus.swift index ebceebd6..43887052 100644 --- a/Mythic/Views/Sheets/InstallStatus.swift +++ b/Mythic/Views/Sheets/InstallStatus.swift @@ -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) @@ -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)