From 1e1091b3657e68b91fc6a3703031f5be506e7a03 Mon Sep 17 00:00:00 2001
From: Ty Lamontagne
Date: Tue, 10 Oct 2023 18:14:23 -0400
Subject: [PATCH] Updater: Fetch best asset size for download size notification
---
pcsx2-qt/AutoUpdaterDialog.cpp | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/pcsx2-qt/AutoUpdaterDialog.cpp b/pcsx2-qt/AutoUpdaterDialog.cpp
index 20b8229c6f..209c4650f7 100644
--- a/pcsx2-qt/AutoUpdaterDialog.cpp
+++ b/pcsx2-qt/AutoUpdaterDialog.cpp
@@ -283,6 +283,7 @@ void AutoUpdaterDialog::getLatestReleaseComplete(QNetworkReply* reply)
m_latest_version = data_object["version"].toString();
m_latest_version_timestamp = QDateTime::fromString(data_object["publishedAt"].toString(), QStringLiteral("yyyy-MM-ddThh:mm:ss.zzzZ"));
m_download_url = best_asset["url"].toString();
+ m_download_size = best_asset["size"].toInt();
found_update_info = true;
}
}
@@ -346,8 +347,6 @@ void AutoUpdaterDialog::getChangesComplete(QNetworkReply* reply)
QString changes_html = tr("Changes:
");
changes_html += QStringLiteral("");
- m_download_size = doc_object["size"].toInt();
-
const QJsonArray commits(doc_object["commits"].toArray());
bool update_will_break_save_states = false;
bool update_increases_settings_version = false;
@@ -393,7 +392,7 @@ void AutoUpdaterDialog::getChangesComplete(QNetworkReply* reply)
"that you will have to reconfigure your settings after this update.
"));
}
changes_html += tr("Installing this update will download %1 MB through your internet connection.
")
- .arg(static_cast(m_download_size) / 1000000.0, 0, 'f', 2);
+ .arg(static_cast(m_download_size) / 1048576.0, 0, 'f', 2);
m_ui.updateNotes->setText(changes_html);
}