mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
Sort modpack versions properly (#5170)
This commit is contained in:
commit
26a2b35a3b
1 changed files with 2 additions and 2 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include "Application.h"
|
||||
#include "Json.h"
|
||||
#include "Version.h"
|
||||
#include "net/NetJob.h"
|
||||
|
||||
#include "modplatform/ModIndex.h"
|
||||
|
|
@ -116,8 +117,7 @@ Task::Ptr ResourceAPI::getProjectVersions(VersionSearchArgs&& args, Callback<QVe
|
|||
}
|
||||
|
||||
auto orderSortPredicate = [](const ModPlatform::IndexedVersion& a, const ModPlatform::IndexedVersion& b) -> bool {
|
||||
// dates are in RFC 3339 format
|
||||
return a.date > b.date;
|
||||
return Version(a.version) > Version(b.version);
|
||||
};
|
||||
std::sort(unsortedVersions.begin(), unsortedVersions.end(), orderSortPredicate);
|
||||
} catch (const JSONValidationError& e) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue