Filtering per mod loader & mc version
This commit is contained in:
@ -34,12 +34,19 @@ void Modrinth::loadIndexedPackVersions(Modrinth::IndexedPack & pack, QJsonArray
|
||||
continue;
|
||||
}
|
||||
// pick the latest version supported
|
||||
file.mcVersion = versionArray[0].toString();
|
||||
for(auto mcVer : versionArray){
|
||||
file.mcVersion.append(mcVer.toString());
|
||||
}
|
||||
auto loaders = Json::requireArray(obj,"loaders");
|
||||
for(auto loader : loaders){
|
||||
file.loaders.append(loader.toString());
|
||||
}
|
||||
file.version = Json::requireString(obj, "name");
|
||||
//TODO show all the files ?
|
||||
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
|
||||
|
@ -19,10 +19,11 @@ struct IndexedVersion {
|
||||
QString addonId;
|
||||
QString fileId;
|
||||
QString version;
|
||||
QString mcVersion;
|
||||
QVector<QString> mcVersion;
|
||||
QString downloadUrl;
|
||||
QString date;
|
||||
QString fileName;
|
||||
QVector<QString> loaders;
|
||||
};
|
||||
|
||||
struct IndexedPack
|
||||
|
Reference in New Issue
Block a user