diff options
author | Sefa Eyeoglu <contact@scrumplex.net> | 2023-10-01 14:32:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-01 14:32:58 +0200 |
commit | eab1180f68a4c994ad09c57ddf78ecd62610caa1 (patch) | |
tree | 34a75105380b19a41e6c79c86efdf0cb17bcc600 /launcher/modplatform/modrinth/ModrinthPackIndex.cpp | |
parent | e3a147f56decaa9ae40c9a9a43e48ddfa53ecc6f (diff) | |
parent | 34294383ebaeff65d2a66a49426b2141c2d840c1 (diff) | |
download | PrismLauncher-eab1180f68a4c994ad09c57ddf78ecd62610caa1.tar.gz PrismLauncher-eab1180f68a4c994ad09c57ddf78ecd62610caa1.tar.bz2 PrismLauncher-eab1180f68a4c994ad09c57ddf78ecd62610caa1.zip |
Merge pull request #1090 from Ryex/feat/acknowledge_release_type
Diffstat (limited to 'launcher/modplatform/modrinth/ModrinthPackIndex.cpp')
-rw-r--r-- | launcher/modplatform/modrinth/ModrinthPackIndex.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/launcher/modplatform/modrinth/ModrinthPackIndex.cpp b/launcher/modplatform/modrinth/ModrinthPackIndex.cpp index 107b9900..f1e77d46 100644 --- a/launcher/modplatform/modrinth/ModrinthPackIndex.cpp +++ b/launcher/modplatform/modrinth/ModrinthPackIndex.cpp @@ -109,8 +109,9 @@ void Modrinth::loadIndexedPackVersions(ModPlatform::IndexedPack& pack, QJsonArra unsortedVersions.append(file); } auto orderSortPredicate = [](const ModPlatform::IndexedVersion& a, const ModPlatform::IndexedVersion& b) -> bool { + bool a_better_release = a.version_type <= b.version_type; // dates are in RFC 3339 format - return a.date > b.date; + return a.date > b.date && a_better_release; }; std::sort(unsortedVersions.begin(), unsortedVersions.end(), orderSortPredicate); pack.versions = unsortedVersions; @@ -149,6 +150,8 @@ auto Modrinth::loadIndexedPackVersion(QJsonObject& obj, QString preferred_hash_t } file.version = Json::requireString(obj, "name"); file.version_number = Json::requireString(obj, "version_number"); + file.version_type = ModPlatform::IndexedVersionType(Json::requireString(obj, "version_type")); + file.changelog = Json::requireString(obj, "changelog"); auto dependencies = Json::ensureArray(obj, "dependencies"); |