NOISSUE update FTB URLs

This commit is contained in:
Petr Mrázek 2019-01-04 01:48:36 +01:00
parent 4b7971f60f
commit ec2732ccd1
4 changed files with 13 additions and 6 deletions

View File

@ -2,6 +2,8 @@
#include <QDomDocument>
#include "FtbPrivatePackManager.h"
#include "net/URLConstants.h"
void FtbPackFetchTask::fetch()
{
publicPacks.clear();
@ -9,11 +11,11 @@ void FtbPackFetchTask::fetch()
NetJob *netJob = new NetJob("FtbModpackFetch");
QUrl publicPacksUrl = QUrl("https://ftb.cursecdn.com/FTB2/static/modpacks.xml");
QUrl publicPacksUrl = QUrl(URLConstants::FTB_CDN_BASE_URL + "static/modpacks.xml");
qDebug() << "Downloading public version info from" << publicPacksUrl.toString();
netJob->addNetAction(Net::Download::makeByteArray(publicPacksUrl, &publicModpacksXmlFileData));
QUrl thirdPartyUrl = QUrl("https://ftb.cursecdn.com/FTB2/static/thirdparty.xml");
QUrl thirdPartyUrl = QUrl(URLConstants::FTB_CDN_BASE_URL + "static/thirdparty.xml");
qDebug() << "Downloading thirdparty version info from" << thirdPartyUrl.toString();
netJob->addNetAction(Net::Download::makeByteArray(thirdPartyUrl, &thirdPartyModpacksXmlFileData));
@ -26,7 +28,7 @@ void FtbPackFetchTask::fetch()
void FtbPackFetchTask::fetchPrivate(const QStringList & toFetch)
{
QString privatePackBaseUrl = QString("https://ftb.cursecdn.com/FTB2/static/%1.xml");
QString privatePackBaseUrl = URLConstants::FTB_CDN_BASE_URL + "static/%1.xml";
for (auto &packCode: toFetch)
{

View File

@ -9,6 +9,8 @@
#include "minecraft/ComponentList.h"
#include "minecraft/GradleSpecifier.h"
#include "net/URLConstants.h"
FtbPackInstallTask::FtbPackInstallTask(FtbModpack pack, QString version)
{
m_pack = pack;
@ -32,11 +34,11 @@ void FtbPackInstallTask::downloadPack()
QString url;
if(m_pack.type == FtbPackType::Private)
{
url = QString("https://ftb.cursecdn.com/FTB2/privatepacks/%1").arg(packoffset);
url = QString(URLConstants::FTB_CDN_BASE_URL + "privatepacks/%1").arg(packoffset);
}
else
{
url = QString("https://ftb.cursecdn.com/FTB2/modpacks/%1").arg(packoffset);
url = QString(URLConstants::FTB_CDN_BASE_URL + "modpacks/%1").arg(packoffset);
}
job->addNetAction(Net::Download::makeCached(url, entry));
archivePath = entry->getFullPath();

View File

@ -29,6 +29,7 @@ const QString IMGUR_BASE_URL("https://api.imgur.com/3/");
const QString FMLLIBS_OUR_BASE_URL("https://files.multimc.org/fmllibs/");
const QString FMLLIBS_FORGE_BASE_URL("https://files.minecraftforge.net/fmllibs/");
const QString TRANSLATIONS_BASE_URL("https://files.multimc.org/translations/");
const QString FTB_CDN_BASE_URL("https://ftb.forgecdn.net/FTB2/");
QString getJarPath(QString version);
QString getLegacyJarUrl(QString version);

View File

@ -10,6 +10,8 @@
#include <RWStorage.h>
#include <Env.h>
#include "net/URLConstants.h"
FtbFilterModel::FtbFilterModel(QObject *parent) : QSortFilterProxyModel(parent)
{
currentSorting = Sorting::ByGameVersion;
@ -214,7 +216,7 @@ void FtbListModel::requestLogo(QString file)
MetaEntryPtr entry = ENV.metacache()->resolveEntry("FTBPacks", QString("logos/%1").arg(file.section(".", 0, 0)));
NetJob *job = new NetJob(QString("FTB Icon Download for %1").arg(file));
job->addNetAction(Net::Download::makeCached(QUrl(QString("https://ftb.cursecdn.com/FTB2/static/%1").arg(file)), entry));
job->addNetAction(Net::Download::makeCached(QUrl(QString(URLConstants::FTB_CDN_BASE_URL + "static/%1").arg(file)), entry));
auto fullPath = entry->getFullPath();
QObject::connect(job, &NetJob::finished, this, [this, file, fullPath]