Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into metadata2

This commit is contained in:
Trial97
2024-08-23 08:34:15 +03:00
159 changed files with 4100 additions and 1473 deletions

View File

@ -18,6 +18,7 @@
#include "ModrinthPackExportTask.h"
#include <QCoreApplication>
#include <QCryptographicHash>
#include <QFileInfo>
#include <QMessageBox>
@ -28,6 +29,7 @@
#include "minecraft/mod/MetadataHandler.h"
#include "minecraft/mod/ModFolderModel.h"
#include "modplatform/helpers/HashUtils.h"
#include "tasks/Task.h"
const QStringList ModrinthPackExportTask::PREFIXES({ "mods/", "coremods/", "resourcepacks/", "texturepacks/", "shaderpacks/" });
const QStringList ModrinthPackExportTask::FILE_EXTENSIONS({ "jar", "litemod", "zip" });
@ -154,8 +156,8 @@ void ModrinthPackExportTask::makeApiRequest()
setStatus(tr("Finding versions for hashes..."));
auto response = std::make_shared<QByteArray>();
task = api.currentVersions(pendingHashes.values(), "sha512", response);
connect(task.get(), &NetJob::succeeded, [this, response]() { parseApiResponse(response); });
connect(task.get(), &NetJob::failed, this, &ModrinthPackExportTask::emitFailed);
connect(task.get(), &Task::succeeded, [this, response]() { parseApiResponse(response); });
connect(task.get(), &Task::failed, this, &ModrinthPackExportTask::emitFailed);
task->start();
}
}