diff options
author | Trial97 <alexandru.tripon97@gmail.com> | 2023-08-27 20:41:56 +0300 |
---|---|---|
committer | Trial97 <alexandru.tripon97@gmail.com> | 2023-08-27 20:41:56 +0300 |
commit | 0680d2dceb27f18b1c888bf16079dfd00d07b3ca (patch) | |
tree | 6874b9733973fc6488a8ebe8bd394f73593b41a7 /launcher/modplatform/flame/FlameAPI.cpp | |
parent | ab6301d5a1a2a77d12d73f4ff7088551d6b8aa2e (diff) | |
parent | 9110fbf2829a48c36fe37cabfb438e165956bbcf (diff) | |
download | PrismLauncher-0680d2dceb27f18b1c888bf16079dfd00d07b3ca.tar.gz PrismLauncher-0680d2dceb27f18b1c888bf16079dfd00d07b3ca.tar.bz2 PrismLauncher-0680d2dceb27f18b1c888bf16079dfd00d07b3ca.zip |
Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into develop
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
Diffstat (limited to 'launcher/modplatform/flame/FlameAPI.cpp')
-rw-r--r-- | launcher/modplatform/flame/FlameAPI.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/launcher/modplatform/flame/FlameAPI.cpp b/launcher/modplatform/flame/FlameAPI.cpp index 74d7db97..e99ce3a5 100644 --- a/launcher/modplatform/flame/FlameAPI.cpp +++ b/launcher/modplatform/flame/FlameAPI.cpp @@ -6,7 +6,6 @@ #include "FlameModIndex.h" #include "Application.h" -#include "BuildConfig.h" #include "Json.h" #include "net/ApiDownload.h" #include "net/ApiUpload.h" @@ -131,19 +130,13 @@ auto FlameAPI::getLatestVersion(VersionSearchArgs&& args) -> ModPlatform::Indexe auto obj = Json::requireObject(doc); auto arr = Json::requireArray(obj, "data"); - QJsonObject latest_file_obj; - ModPlatform::IndexedVersion ver_tmp; - for (auto file : arr) { auto file_obj = Json::requireObject(file); auto file_tmp = FlameMod::loadIndexedPackVersion(file_obj); - if (file_tmp.date > ver_tmp.date) { - ver_tmp = file_tmp; - latest_file_obj = file_obj; - } + if (file_tmp.date > ver.date && (!args.loaders.has_value() || !file_tmp.loaders || args.loaders.value() & file_tmp.loaders)) + ver = file_tmp; } - ver = FlameMod::loadIndexedPackVersion(latest_file_obj); } catch (Json::JsonException& e) { qCritical() << "Failed to parse response from a version request."; qCritical() << e.what(); |