GH-3633 assume latest MC version, if CurseForge pack supports multiple

right now these are unused anyway
This commit is contained in:
phit 2021-03-24 19:44:26 +01:00
parent 73af0f271a
commit ba13e33ccc

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();