refactor: split out setting api headers for downloads
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
This commit is contained in:
@ -36,7 +36,7 @@
|
||||
#include "Library.h"
|
||||
#include "MinecraftInstance.h"
|
||||
|
||||
#include <net/Download.h>
|
||||
#include <net/ApiDownload.h>
|
||||
#include <net/ChecksumValidator.h>
|
||||
#include <FileSystem.h>
|
||||
#include <BuildConfig.h>
|
||||
@ -129,14 +129,14 @@ QList<NetAction::Ptr> Library::getDownloads(
|
||||
if(sha1.size())
|
||||
{
|
||||
auto rawSha1 = QByteArray::fromHex(sha1.toLatin1());
|
||||
auto dl = Net::Download::makeCached(url, entry, options);
|
||||
auto dl = Net::ApiDownload::makeCached(url, entry, options);
|
||||
dl->addValidator(new Net::ChecksumValidator(QCryptographicHash::Sha1, rawSha1));
|
||||
qDebug() << "Checksummed Download for:" << rawName().serialize() << "storage:" << storage << "url:" << url;
|
||||
out.append(dl);
|
||||
}
|
||||
else
|
||||
{
|
||||
out.append(Net::Download::makeCached(url, entry, options));
|
||||
out.append(Net::ApiDownload::makeCached(url, entry, options));
|
||||
qDebug() << "Download for:" << rawName().serialize() << "storage:" << storage << "url:" << url;
|
||||
}
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user