fix: implement PR suggestions
Some stylistic changes, and get hashes from the mod providers when building the metadata.
This commit is contained in:
@ -24,6 +24,7 @@
|
||||
#include "net/NetJob.h"
|
||||
|
||||
static ModrinthAPI api;
|
||||
static ModPlatform::ProviderCapabilities ProviderCaps;
|
||||
|
||||
void Modrinth::loadIndexedPack(ModPlatform::IndexedPack& pack, QJsonObject& obj)
|
||||
{
|
||||
@ -95,6 +96,9 @@ void Modrinth::loadIndexedPackVersions(ModPlatform::IndexedPack& pack,
|
||||
if (parent.contains("url")) {
|
||||
file.downloadUrl = Json::requireString(parent, "url");
|
||||
file.fileName = Json::requireString(parent, "filename");
|
||||
auto hash_list = Json::requireObject(parent, "hashes");
|
||||
if(hash_list.contains(ProviderCaps.hashType(ModPlatform::Provider::MODRINTH)))
|
||||
file.hash = Json::requireString(hash_list, ProviderCaps.hashType(ModPlatform::Provider::MODRINTH));
|
||||
|
||||
unsortedVersions.append(file);
|
||||
}
|
||||
|
Reference in New Issue
Block a user