NOISSUE Modrinth exporter: lookup all hashes in one request

This commit is contained in:
arthomnix
2023-02-05 21:09:16 +00:00
parent 496440cbc8
commit 4f95e4618f
5 changed files with 219 additions and 50 deletions

View File

@@ -11,6 +11,7 @@
#include "BaseInstance.h"
#include "net/NetJob.h"
#include "ui/dialogs/ModrinthExportDialog.h"
#include "ModrinthHashLookupRequest.h"
namespace Modrinth
{
@@ -35,13 +36,6 @@ struct ExportSettings
QString exportPath;
};
struct HashLookupData
{
QFileInfo fileInfo;
QString sha512;
QByteArray response;
};
// Using the existing Modrinth::File struct from the importer doesn't actually make much sense here (doesn't support multiple hashes, hash is a byte array rather than a string, no file size, etc)
struct ExportFile
{
@@ -71,7 +65,7 @@ private slots:
private:
InstancePtr m_instance;
ExportSettings m_settings;
QList<HashLookupData> m_responses;
std::shared_ptr<QList<HashLookupResponseData>> m_response;
NetJob::Ptr m_netJob;
};