From f8dc58665b8711be991638e1c35b9ed1786e3fee Mon Sep 17 00:00:00 2001 From: Trial97 Date: Wed, 1 Jan 2025 01:36:17 +0200 Subject: [PATCH] map modrinth snapshots Signed-off-by: Trial97 (cherry picked from commit 1d8bf1d5a788e689d26e0afa8f5cfca0e3859e5d) --- launcher/modplatform/modrinth/ModrinthAPI.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/launcher/modplatform/modrinth/ModrinthAPI.h b/launcher/modplatform/modrinth/ModrinthAPI.h index 070f59dad..43fa956e6 100644 --- a/launcher/modplatform/modrinth/ModrinthAPI.h +++ b/launcher/modplatform/modrinth/ModrinthAPI.h @@ -168,9 +168,16 @@ class ModrinthAPI : public NetworkResourceAPI { QString getGameVersionsArray(std::list mcVersions) const { + static const QString preString = " Pre-Release "; QString s; for (auto& ver : mcVersions) { - s += QString("\"versions:%1\",").arg(ver.toString()); + auto verStr = ver.toString(); + + if (verStr.contains(preString)) { + verStr.replace(preString, "-pre"); + } + verStr.replace(" ", "-"); + s += QString("\"versions:%1\",").arg(verStr); } s.remove(s.length() - 1, 1); // remove last comma return s.isEmpty() ? QString() : s;