summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--api/logic/modplatform/ftb/FtbPackFetchTask.cpp8
-rw-r--r--api/logic/modplatform/ftb/FtbPackInstallTask.cpp6
-rw-r--r--api/logic/net/URLConstants.h1
-rw-r--r--application/pages/modplatform/FtbListModel.cpp4
4 files changed, 13 insertions, 6 deletions
diff --git a/api/logic/modplatform/ftb/FtbPackFetchTask.cpp b/api/logic/modplatform/ftb/FtbPackFetchTask.cpp
index 19f6c31a..fe3f3fac 100644
--- a/api/logic/modplatform/ftb/FtbPackFetchTask.cpp
+++ b/api/logic/modplatform/ftb/FtbPackFetchTask.cpp
@@ -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)
{
diff --git a/api/logic/modplatform/ftb/FtbPackInstallTask.cpp b/api/logic/modplatform/ftb/FtbPackInstallTask.cpp
index ecacda02..4962bcac 100644
--- a/api/logic/modplatform/ftb/FtbPackInstallTask.cpp
+++ b/api/logic/modplatform/ftb/FtbPackInstallTask.cpp
@@ -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();
diff --git a/api/logic/net/URLConstants.h b/api/logic/net/URLConstants.h
index 5365894b..0219a446 100644
--- a/api/logic/net/URLConstants.h
+++ b/api/logic/net/URLConstants.h
@@ -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);
diff --git a/application/pages/modplatform/FtbListModel.cpp b/application/pages/modplatform/FtbListModel.cpp
index f4311afb..51aec890 100644
--- a/application/pages/modplatform/FtbListModel.cpp
+++ b/application/pages/modplatform/FtbListModel.cpp
@@ -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]