Added the downloading of the mods

This commit is contained in:
timoreo 2022-01-14 12:47:18 +01:00
parent 4d599eb118
commit 9e6fa8f29a
No known key found for this signature in database
GPG key ID: 121A72C3512BA288
7 changed files with 54 additions and 8 deletions

View file

@ -37,7 +37,9 @@ void Modrinth::loadIndexedPackVersions(Modrinth::IndexedPack & pack, QJsonArray
file.mcVersion = versionArray[0].toString();
file.version = Json::requireString(obj, "name");
//TODO show all the files ?
file.downloadUrl = Json::requireString(Json::requireArray(obj, "files")[0].toObject(),"url");
auto parent = Json::requireArray(obj, "files")[0].toObject();
file.downloadUrl = Json::requireString(parent, "url");
file.fileName = Json::requireString(parent, "filename");
unsortedVersions.append(file);
}
auto orderSortPredicate = [](const IndexedVersion & a, const IndexedVersion & b) -> bool