revert back the release order
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
eab1180f68
commit
77979b4c95
@ -133,9 +133,7 @@ auto FlameAPI::getLatestVersion(VersionSearchArgs&& args) -> ModPlatform::Indexe
|
|||||||
for (auto file : arr) {
|
for (auto file : arr) {
|
||||||
auto file_obj = Json::requireObject(file);
|
auto file_obj = Json::requireObject(file);
|
||||||
auto file_tmp = FlameMod::loadIndexedPackVersion(file_obj);
|
auto file_tmp = FlameMod::loadIndexedPackVersion(file_obj);
|
||||||
if (file_tmp.date > ver.date &&
|
if (file_tmp.date > ver.date && (!args.loaders.has_value() || !file_tmp.loaders || args.loaders.value() & file_tmp.loaders))
|
||||||
(!args.loaders.has_value() || !file_tmp.loaders || args.loaders.value() & file_tmp.loaders) &&
|
|
||||||
file_tmp.version_type <= ver.version_type)
|
|
||||||
ver = file_tmp;
|
ver = file_tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,9 +96,8 @@ void FlameMod::loadIndexedPackVersions(ModPlatform::IndexedPack& pack,
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto orderSortPredicate = [](const ModPlatform::IndexedVersion& a, const ModPlatform::IndexedVersion& b) -> bool {
|
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
|
// dates are in RFC 3339 format
|
||||||
return a.date > b.date && a_better_release;
|
return a.date > b.date;
|
||||||
};
|
};
|
||||||
std::sort(unsortedVersions.begin(), unsortedVersions.end(), orderSortPredicate);
|
std::sort(unsortedVersions.begin(), unsortedVersions.end(), orderSortPredicate);
|
||||||
pack.versions = unsortedVersions;
|
pack.versions = unsortedVersions;
|
||||||
|
@ -109,9 +109,8 @@ void Modrinth::loadIndexedPackVersions(ModPlatform::IndexedPack& pack, QJsonArra
|
|||||||
unsortedVersions.append(file);
|
unsortedVersions.append(file);
|
||||||
}
|
}
|
||||||
auto orderSortPredicate = [](const ModPlatform::IndexedVersion& a, const ModPlatform::IndexedVersion& b) -> bool {
|
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
|
// dates are in RFC 3339 format
|
||||||
return a.date > b.date && a_better_release;
|
return a.date > b.date;
|
||||||
};
|
};
|
||||||
std::sort(unsortedVersions.begin(), unsortedVersions.end(), orderSortPredicate);
|
std::sort(unsortedVersions.begin(), unsortedVersions.end(), orderSortPredicate);
|
||||||
pack.versions = unsortedVersions;
|
pack.versions = unsortedVersions;
|
||||||
|
Loading…
Reference in New Issue
Block a user