aboutsummaryrefslogtreecommitdiff
path: root/launcher/modplatform/modrinth/ModrinthPackExportTask.cpp
diff options
context:
space:
mode:
authorTheKodeToad <TheKodeToad@proton.me>2023-08-13 13:10:58 +0100
committerGitHub <noreply@github.com>2023-08-13 13:10:58 +0100
commita44cb6430eac81e6e89283c50b57142ca7f05747 (patch)
treef51678d129432b0a68d22de0178ccb8fd4f9a927 /launcher/modplatform/modrinth/ModrinthPackExportTask.cpp
parent44153a28e369943ea16545146fec81f7a62e44dd (diff)
parent35358f8180468af1572c35425b1f60c899d6b07d (diff)
downloadPrismLauncher-a44cb6430eac81e6e89283c50b57142ca7f05747.tar.gz
PrismLauncher-a44cb6430eac81e6e89283c50b57142ca7f05747.tar.bz2
PrismLauncher-a44cb6430eac81e6e89283c50b57142ca7f05747.zip
Merge pull request #1107 from Ryex/chore/add-compiler-warnings
Introduce more strict compiler warnings and fix them
Diffstat (limited to 'launcher/modplatform/modrinth/ModrinthPackExportTask.cpp')
-rw-r--r--launcher/modplatform/modrinth/ModrinthPackExportTask.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/launcher/modplatform/modrinth/ModrinthPackExportTask.cpp b/launcher/modplatform/modrinth/ModrinthPackExportTask.cpp
index 7bf29639..64d31f42 100644
--- a/launcher/modplatform/modrinth/ModrinthPackExportTask.cpp
+++ b/launcher/modplatform/modrinth/ModrinthPackExportTask.cpp
@@ -174,10 +174,10 @@ void ModrinthPackExportTask::parseApiResponse(const std::shared_ptr<QByteArray>
if (obj.isEmpty())
continue;
- const QJsonArray files = obj["files"].toArray();
- if (auto fileIter = std::find_if(files.begin(), files.end(),
+ const QJsonArray files_array = obj["files"].toArray();
+ if (auto fileIter = std::find_if(files_array.begin(), files_array.end(),
[&iterator](const QJsonValue& file) { return file["hashes"]["sha512"] == iterator.value(); });
- fileIter != files.end()) {
+ fileIter != files_array.end()) {
// map the file to the url
resolvedFiles[iterator.key()] =
ResolvedFile{ fileIter->toObject()["hashes"].toObject()["sha1"].toString(), iterator.value(),
@@ -260,6 +260,7 @@ QByteArray ModrinthPackExportTask::generateIndex()
out["dependencies"] = dependencies;
}
+
QJsonArray filesOut;
for (auto iterator = resolvedFiles.constBegin(); iterator != resolvedFiles.constEnd(); iterator++) {
QJsonObject fileOut;
@@ -287,6 +288,7 @@ QByteArray ModrinthPackExportTask::generateIndex()
hashes["sha512"] = value.sha512;
fileOut["hashes"] = hashes;
+
fileOut["fileSize"] = value.size;
filesOut << fileOut;
}