Rework curseforge download (#611)

* Use the bulk endpoint on mod resolution for faster download
* Search on modrinth for api blocked mods
* Display a dialog for manually downloading blocked mods
This commit is contained in:
timoreo22
2022-05-28 21:53:12 +02:00
committed by GitHub
parent fcbe233fdb
commit 699ad316f0
14 changed files with 633 additions and 103 deletions

31
launcher/net/Upload.h Normal file
View File

@ -0,0 +1,31 @@
#pragma once
#include "NetAction.h"
#include "Sink.h"
namespace Net {
class Upload : public NetAction {
Q_OBJECT
public:
static Upload::Ptr makeByteArray(QUrl url, QByteArray *output, QByteArray m_post_data);
protected slots:
void downloadProgress(qint64 bytesReceived, qint64 bytesTotal) override;
void downloadError(QNetworkReply::NetworkError error) override;
void sslErrors(const QList<QSslError> & errors);
void downloadFinished() override;
void downloadReadyRead() override;
public slots:
void executeTask() override;
private:
std::unique_ptr<Sink> m_sink;
QByteArray m_post_data;
bool handleRedirect();
};
} // Net