Qt: Fix auto updater half complete state on missing asset

This commit is contained in:
Stenzek
2026-01-17 19:33:32 +10:00
parent 54692a842b
commit 70d286516e

View File

@@ -406,33 +406,34 @@ void AutoUpdaterDialog::getLatestReleaseComplete(s32 status_code, const Error& e
}
}
if (!asset_found)
if (asset_found)
{
reportError("Asset not found");
const QString current_date = QtHost::FormatNumber(
Host::NumberFormatType::ShortDateTime,
static_cast<s64>(
QDateTime::fromString(QString::fromUtf8(g_scm_date_str), Qt::DateFormat::ISODate).toSecsSinceEpoch()));
const QString release_date = QtHost::FormatNumber(
Host::NumberFormatType::ShortDateTime,
static_cast<s64>(
QDateTime::fromString(doc_object["published_at"].toString(), Qt::DateFormat::ISODate).toSecsSinceEpoch()));
m_ui.currentVersion->setText(tr("%1 (%2)")
.arg(QtUtils::StringViewToQString(
TinyString::from_format("{}/{}", g_scm_version_str, UPDATER_RELEASE_CHANNEL)))
.arg(current_date));
m_ui.newVersion->setText(tr("%1 (%2)").arg(QString::fromStdString(getCurrentUpdateTag())).arg(release_date));
m_ui.downloadSize->setText(tr("%1 MB").arg(static_cast<double>(m_download_size) / 1000000.0, 0, 'f', 2));
m_ui.downloadAndInstall->setEnabled(true);
m_ui.updateNotes->setText(tr("Loading..."));
queueGetChanges();
emit updateCheckCompleted(true);
return;
}
const QString current_date = QtHost::FormatNumber(
Host::NumberFormatType::ShortDateTime,
static_cast<s64>(
QDateTime::fromString(QString::fromUtf8(g_scm_date_str), Qt::DateFormat::ISODate).toSecsSinceEpoch()));
const QString release_date = QtHost::FormatNumber(
Host::NumberFormatType::ShortDateTime,
static_cast<s64>(
QDateTime::fromString(doc_object["published_at"].toString(), Qt::DateFormat::ISODate).toSecsSinceEpoch()));
m_ui.currentVersion->setText(tr("%1 (%2)")
.arg(QtUtils::StringViewToQString(
TinyString::from_format("{}/{}", g_scm_version_str, UPDATER_RELEASE_CHANNEL)))
.arg(current_date));
m_ui.newVersion->setText(tr("%1 (%2)").arg(QString::fromStdString(getCurrentUpdateTag())).arg(release_date));
m_ui.downloadSize->setText(tr("%1 MB").arg(static_cast<double>(m_download_size) / 1000000.0, 0, 'f', 2));
m_ui.downloadAndInstall->setEnabled(true);
m_ui.updateNotes->setText(tr("Loading..."));
queueGetChanges();
emit updateCheckCompleted(true);
return;
else
{
reportError("Asset not found");
}
}
else
{