Merge pull request #3686 from phit/fix/3633

GH-3633 assume latest MC version, if CurseForge pack supports multiple
This commit is contained in:
Petr Mrázek 2021-03-26 20:36:00 +00:00 committed by GitHub
commit 9d76219434
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -263,11 +263,12 @@ void Flame::ListModel::searchRequestFinished()
}
pack.latestFile.addonId = pack.addonId;
pack.latestFile.fileId = id;
// FIXME: what to do when there's more than one, or there's no version?
auto versionArray = file.value("gameVersion").toArray();
if(versionArray.size() != 1) {
if(versionArray.size() < 1) {
continue;
}
// pick the latest version supported
pack.latestFile.mcVersion = versionArray[0].toString();
pack.latestFile.version = file.value("displayName").toString();
pack.latestFile.downloadUrl = file.value("downloadUrl").toString();