From c2af6663aba075c03041a6869b7ba8af4139f5a5 Mon Sep 17 00:00:00 2001 From: Bionus Date: Tue, 9 Jan 2024 02:51:12 +0100 Subject: [PATCH] fix: update checker for nightly version (fix #3080) --- src/lib/src/updater/program-updater.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lib/src/updater/program-updater.cpp b/src/lib/src/updater/program-updater.cpp index 3124ad597..9ef240979 100644 --- a/src/lib/src/updater/program-updater.cpp +++ b/src/lib/src/updater/program-updater.cpp @@ -41,9 +41,11 @@ void ProgramUpdater::checkForUpdatesDone() QJsonObject lastRelease = json.object(); #if defined NIGHTLY - QString latest = lastRelease["target_commitish"].toString(); - QString current = QString(NIGHTLY_COMMIT); - bool isNew = !current.isEmpty() && latest != current; + static const QRegularExpression regexHead(R"(Head:\**\s*([a-f0-9]{40}))"); + const auto match = regexHead.match(lastRelease["body"].toString()); + QString latest = match.hasMatch() ? match.captured(1) : lastRelease["target_commitish"].toString(); + const QString current = QString(NIGHTLY_COMMIT); + const bool isNew = !current.isEmpty() && latest != current; latest = latest.left(8); QString changelog; #else