fix: implement PR suggestions
Some stylistic changes, and get hashes from the mod providers when building the metadata.
This commit is contained in:
@ -6,6 +6,8 @@
|
||||
#include "modplatform/flame/FlameAPI.h"
|
||||
#include "net/NetJob.h"
|
||||
|
||||
static ModPlatform::ProviderCapabilities ProviderCaps;
|
||||
|
||||
void FlameMod::loadIndexedPack(ModPlatform::IndexedPack& pack, QJsonObject& obj)
|
||||
{
|
||||
pack.addonId = Json::requireInteger(obj, "id");
|
||||
@ -60,6 +62,12 @@ void FlameMod::loadIndexedPackVersions(ModPlatform::IndexedPack& pack,
|
||||
file.downloadUrl = Json::requireString(obj, "downloadUrl");
|
||||
file.fileName = Json::requireString(obj, "fileName");
|
||||
|
||||
auto hash_list = Json::ensureArray(obj, "hashes");
|
||||
if(!hash_list.isEmpty()){
|
||||
if(hash_list.contains(ProviderCaps.hashType(ModPlatform::Provider::FLAME)))
|
||||
file.hash = Json::requireString(hash_list, "value");
|
||||
}
|
||||
|
||||
unsortedVersions.append(file);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user