NOISSUE finalize curse modpack import work
This commit is contained in:
@ -3,17 +3,19 @@
|
||||
|
||||
const char * metabase = "https://cursemeta.dries007.net";
|
||||
|
||||
Curse::FileResolvingTask::FileResolvingTask(QVector<Curse::File>& toProcess)
|
||||
Curse::FileResolvingTask::FileResolvingTask(Curse::Manifest& toProcess)
|
||||
: m_toProcess(toProcess)
|
||||
{
|
||||
}
|
||||
|
||||
void Curse::FileResolvingTask::executeTask()
|
||||
{
|
||||
setStatus(tr("Resolving curse mod IDs..."));
|
||||
setProgress(0, m_toProcess.files.size());
|
||||
m_dljob.reset(new NetJob("Curse file resolver"));
|
||||
results.resize(m_toProcess.size());
|
||||
results.resize(m_toProcess.files.size());
|
||||
int index = 0;
|
||||
for(auto & file: m_toProcess)
|
||||
for(auto & file: m_toProcess.files)
|
||||
{
|
||||
auto projectIdStr = QString::number(file.projectId);
|
||||
auto fileIdStr = QString::number(file.fileId);
|
||||
@ -42,7 +44,7 @@ void Curse::FileResolvingTask::netJobFinished()
|
||||
failed = true;
|
||||
continue;
|
||||
}
|
||||
auto & out = m_toProcess[index];
|
||||
auto & out = m_toProcess.files[index];
|
||||
out.fileName = Json::requireString(obj, "FileNameOnDisk");
|
||||
out.url = Json::requireString(obj, "DownloadURL");
|
||||
out.resolved = true;
|
||||
|
@ -12,8 +12,8 @@ class MULTIMC_LOGIC_EXPORT FileResolvingTask : public Task
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit FileResolvingTask(QVector<Curse::File> &toProcess);
|
||||
const QVector<Curse::File> &getResults() const
|
||||
explicit FileResolvingTask(Curse::Manifest &toProcess);
|
||||
const Curse::Manifest &getResults() const
|
||||
{
|
||||
return m_toProcess;
|
||||
}
|
||||
@ -25,7 +25,7 @@ protected slots:
|
||||
void netJobFinished();
|
||||
|
||||
private: /* data */
|
||||
QVector<Curse::File> m_toProcess;
|
||||
Curse::Manifest m_toProcess;
|
||||
QVector<QByteArray> results;
|
||||
NetJobPtr m_dljob;
|
||||
};
|
||||
|
@ -11,7 +11,7 @@ static void loadFileV1(Curse::File & f, QJsonObject & file)
|
||||
static void loadModloaderV1(Curse::Modloader & m, QJsonObject & modLoader)
|
||||
{
|
||||
m.id = Json::requireString(modLoader, "id");
|
||||
m.primary = Json::ensureBoolean(modLoader, "primary", false);
|
||||
m.primary = Json::ensureBoolean(modLoader, QString("primary"), false);
|
||||
}
|
||||
|
||||
static void loadMinecraftV1(Curse::Minecraft & m, QJsonObject & minecraft)
|
||||
|
Reference in New Issue
Block a user