feat: display release type

Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
This commit is contained in:
Rachel Powers
2023-05-26 16:23:43 -07:00
parent c156034069
commit cf4df19986
17 changed files with 73 additions and 34 deletions

View File

@ -94,9 +94,7 @@ void FlameMod::loadIndexedPackVersions(ModPlatform::IndexedPack& pack,
}
auto orderSortPredicate = [](const ModPlatform::IndexedVersion& a, const ModPlatform::IndexedVersion& b) -> bool {
bool a_better_release = true;
if (a.verison_type.has_value() && b.verison_type.has_value())
a_better_release = a.verison_type.value() < b.verison_type.value();
bool a_better_release = a.verison_type < b.verison_type;
// dates are in RFC 3339 format
return a.date > b.date && a_better_release;
};
@ -126,9 +124,7 @@ auto FlameMod::loadIndexedPackVersion(QJsonObject& obj, bool load_changelog) ->
file.version = Json::requireString(obj, "displayName");
file.downloadUrl = Json::ensureString(obj, "downloadUrl");
file.fileName = Json::requireString(obj, "fileName");
auto version_type = ModPlatform::IndexedVersionType(Json::requireInteger(obj, "releaseType"));
if (version_type.isValid())
file.verison_type = version_type;
file.verison_type = ModPlatform::IndexedVersionType(Json::requireInteger(obj, "releaseType"));
auto hash_list = Json::ensureArray(obj, "hashes");
for (auto h : hash_list) {