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/modrinth | |
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/modrinth')
-rw-r--r-- | launcher/modplatform/modrinth/ModrinthPackIndex.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/launcher/modplatform/modrinth/ModrinthPackIndex.cpp b/launcher/modplatform/modrinth/ModrinthPackIndex.cpp index 6c8659dc..8b750740 100644 --- a/launcher/modplatform/modrinth/ModrinthPackIndex.cpp +++ b/launcher/modplatform/modrinth/ModrinthPackIndex.cpp @@ -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); } |