mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
Sort modpack entries by version, rather than publishing date
This fixes issues the display order while using packs like Fabolously Optimized, who release versions out of order Signed-off-by: TheCourierNV <andreascart04@gmail.com>
This commit is contained in:
parent
8cb9262b09
commit
9e3893fd62
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"
|
||||
|
|
@ -114,8 +115,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