diff options
author | flow <thiagodonato300@gmail.com> | 2022-04-21 15:45:20 -0300 |
---|---|---|
committer | flow <flowlnlnln@gmail.com> | 2022-05-23 14:43:09 -0300 |
commit | e17b6804a7424dd5161662c4ef92972f3311675c (patch) | |
tree | 2d6e5268d3ce2499d6e765797c35a4bec7062aa3 /launcher/modplatform/flame/FlameModIndex.cpp | |
parent | 96e36f060443cbfa6d58df2adca3c8605851b4a3 (diff) | |
download | PrismLauncher-e17b6804a7424dd5161662c4ef92972f3311675c.tar.gz PrismLauncher-e17b6804a7424dd5161662c4ef92972f3311675c.tar.bz2 PrismLauncher-e17b6804a7424dd5161662c4ef92972f3311675c.zip |
fix: implement PR suggestions
Some stylistic changes, and get hashes from the mod providers when
building the metadata.
Diffstat (limited to 'launcher/modplatform/flame/FlameModIndex.cpp')
-rw-r--r-- | launcher/modplatform/flame/FlameModIndex.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/launcher/modplatform/flame/FlameModIndex.cpp b/launcher/modplatform/flame/FlameModIndex.cpp index 45f02b71..4b172c13 100644 --- a/launcher/modplatform/flame/FlameModIndex.cpp +++ b/launcher/modplatform/flame/FlameModIndex.cpp @@ -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); } |