aboutsummaryrefslogtreecommitdiff
path: root/launcher/modplatform
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/modplatform')
-rw-r--r--launcher/modplatform/ModAPI.h38
-rw-r--r--launcher/modplatform/ModIndex.h42
-rw-r--r--launcher/modplatform/flame/FlameAPI.h32
-rw-r--r--launcher/modplatform/flame/FlameModIndex.cpp62
-rw-r--r--launcher/modplatform/flame/FlameModIndex.h50
-rw-r--r--launcher/modplatform/helpers/NetworkModAPI.cpp60
-rw-r--r--launcher/modplatform/helpers/NetworkModAPI.h13
-rw-r--r--launcher/modplatform/modrinth/ModrinthAPI.h73
-rw-r--r--launcher/modplatform/modrinth/ModrinthPackIndex.cpp63
-rw-r--r--launcher/modplatform/modrinth/ModrinthPackIndex.h50
10 files changed, 331 insertions, 152 deletions
diff --git a/launcher/modplatform/ModAPI.h b/launcher/modplatform/ModAPI.h
new file mode 100644
index 00000000..ae6ac80f
--- /dev/null
+++ b/launcher/modplatform/ModAPI.h
@@ -0,0 +1,38 @@
+#pragma once
+
+#include <QString>
+#include <QList>
+
+namespace ModPlatform {
+class ListModel;
+}
+
+class ModAPI {
+ protected:
+ using CallerType = ModPlatform::ListModel;
+
+ public:
+ virtual ~ModAPI() = default;
+
+ // https://docs.curseforge.com/?http#tocS_ModLoaderType
+ enum ModLoaderType { Any = 0, Forge = 1, Cauldron = 2, LiteLoader = 3, Fabric = 4 };
+
+ struct SearchArgs {
+ int offset;
+ QString search;
+ QString sorting;
+ ModLoaderType mod_loader;
+ QString version;
+ };
+
+ virtual void searchMods(CallerType* caller, SearchArgs&& args) const = 0;
+
+
+ struct VersionSearchArgs {
+ QString addonId;
+ QList<QString> mcVersions;
+ ModLoaderType loader;
+ };
+
+ virtual void getVersions(CallerType* caller, VersionSearchArgs&& args) const = 0;
+};
diff --git a/launcher/modplatform/ModIndex.h b/launcher/modplatform/ModIndex.h
new file mode 100644
index 00000000..7e1cf254
--- /dev/null
+++ b/launcher/modplatform/ModIndex.h
@@ -0,0 +1,42 @@
+#pragma once
+
+#include <QList>
+#include <QMetaType>
+#include <QString>
+#include <QVariant>
+#include <QVector>
+
+namespace ModPlatform {
+
+struct ModpackAuthor {
+ QString name;
+ QString url;
+};
+
+struct IndexedVersion {
+ QVariant addonId;
+ QVariant fileId;
+ QString version;
+ QVector<QString> mcVersion;
+ QString downloadUrl;
+ QString date;
+ QString fileName;
+ QVector<QString> loaders = {};
+};
+
+struct IndexedPack {
+ QVariant addonId;
+ QString name;
+ QString description;
+ QList<ModpackAuthor> authors;
+ QString logoName;
+ QString logoUrl;
+ QString websiteUrl;
+
+ bool versionsLoaded = false;
+ QVector<IndexedVersion> versions;
+};
+
+} // namespace ModPlatform
+
+Q_DECLARE_METATYPE(ModPlatform::IndexedPack)
diff --git a/launcher/modplatform/flame/FlameAPI.h b/launcher/modplatform/flame/FlameAPI.h
new file mode 100644
index 00000000..8654a693
--- /dev/null
+++ b/launcher/modplatform/flame/FlameAPI.h
@@ -0,0 +1,32 @@
+#pragma once
+
+#include "modplatform/helpers/NetworkModAPI.h"
+
+class FlameAPI : public NetworkModAPI {
+ private:
+ inline auto getModSearchURL(SearchArgs& args) const -> QString override
+ {
+ return QString(
+ "https://addons-ecs.forgesvc.net/api/v2/addon/search?"
+ "gameId=432&"
+ "categoryId=0&"
+ "sectionId=6&"
+
+ "index=%1&"
+ "pageSize=25&"
+ "searchFilter=%2&"
+ "sort=%3&"
+ "modLoaderType=%4&"
+ "gameVersion=%5")
+ .arg(args.offset)
+ .arg(args.search)
+ .arg(args.sorting)
+ .arg(args.mod_loader)
+ .arg(args.version);
+ };
+
+ inline auto getVersionsURL(VersionSearchArgs& args) const -> QString override
+ {
+ return QString("https://addons-ecs.forgesvc.net/api/v2/addon/%1/files").arg(args.addonId);
+ };
+};
diff --git a/launcher/modplatform/flame/FlameModIndex.cpp b/launcher/modplatform/flame/FlameModIndex.cpp
index 4adaf5f1..2c3adee4 100644
--- a/launcher/modplatform/flame/FlameModIndex.cpp
+++ b/launcher/modplatform/flame/FlameModIndex.cpp
@@ -1,13 +1,11 @@
-#include <QObject>
#include "FlameModIndex.h"
+
#include "Json.h"
-#include "net/NetJob.h"
-#include "BaseInstance.h"
#include "minecraft/MinecraftInstance.h"
#include "minecraft/PackProfile.h"
+#include "net/NetJob.h"
-
-void FlameMod::loadIndexedPack(FlameMod::IndexedPack & pack, QJsonObject & obj)
+void FlameMod::loadIndexedPack(ModPlatform::IndexedPack& pack, QJsonObject& obj)
{
pack.addonId = Json::requireInteger(obj, "id");
pack.name = Json::requireString(obj, "name");
@@ -16,10 +14,10 @@ void FlameMod::loadIndexedPack(FlameMod::IndexedPack & pack, QJsonObject & obj)
bool thumbnailFound = false;
auto attachments = Json::requireArray(obj, "attachments");
- for(auto attachmentRaw: attachments) {
+ for (auto attachmentRaw : attachments) {
auto attachmentObj = Json::requireObject(attachmentRaw);
bool isDefault = attachmentObj.value("isDefault").toBool(false);
- if(isDefault) {
+ if (isDefault) {
thumbnailFound = true;
pack.logoName = Json::requireString(attachmentObj, "title");
pack.logoUrl = Json::requireString(attachmentObj, "thumbnailUrl");
@@ -27,37 +25,35 @@ void FlameMod::loadIndexedPack(FlameMod::IndexedPack & pack, QJsonObject & obj)
}
}
- if(!thumbnailFound) {
- throw JSONValidationError(QString("Pack without an icon, skipping: %1").arg(pack.name));
- }
-
+ if (!thumbnailFound) { throw JSONValidationError(QString("Pack without an icon, skipping: %1").arg(pack.name)); }
auto authors = Json::requireArray(obj, "authors");
- for(auto authorIter: authors) {
+ for (auto authorIter : authors) {
auto author = Json::requireObject(authorIter);
- FlameMod::ModpackAuthor packAuthor;
+ ModPlatform::ModpackAuthor packAuthor;
packAuthor.name = Json::requireString(author, "name");
packAuthor.url = Json::requireString(author, "url");
pack.authors.append(packAuthor);
}
}
-void FlameMod::loadIndexedPackVersions(FlameMod::IndexedPack & pack, QJsonArray & arr, const shared_qobject_ptr<QNetworkAccessManager>& network, BaseInstance * inst)
+void FlameMod::loadIndexedPackVersions(ModPlatform::IndexedPack& pack,
+ QJsonArray& arr,
+ const shared_qobject_ptr<QNetworkAccessManager>& network,
+ BaseInstance* inst)
{
- QVector<FlameMod::IndexedVersion> unsortedVersions;
- bool hasFabric = !((MinecraftInstance *)inst)->getPackProfile()->getComponentVersion("net.fabricmc.fabric-loader").isEmpty();
- QString mcVersion = ((MinecraftInstance *)inst)->getPackProfile()->getComponentVersion("net.minecraft");
+ QVector<ModPlatform::IndexedVersion> unsortedVersions;
+ bool hasFabric = !(dynamic_cast<MinecraftInstance*>(inst))->getPackProfile()->getComponentVersion("net.fabricmc.fabric-loader").isEmpty();
+ QString mcVersion = (dynamic_cast<MinecraftInstance*>(inst))->getPackProfile()->getComponentVersion("net.minecraft");
- for(auto versionIter: arr) {
+ for (auto versionIter : arr) {
auto obj = versionIter.toObject();
auto versionArray = Json::requireArray(obj, "gameVersion");
- if (versionArray.isEmpty()) {
- continue;
- }
+ if (versionArray.isEmpty()) { continue; }
- FlameMod::IndexedVersion file;
- for(auto mcVer : versionArray){
+ ModPlatform::IndexedVersion file;
+ for (auto mcVer : versionArray) {
file.mcVersion.append(mcVer.toString());
}
@@ -70,29 +66,27 @@ void FlameMod::loadIndexedPackVersions(FlameMod::IndexedPack & pack, QJsonArray
auto modules = Json::requireArray(obj, "modules");
bool is_valid_fabric_version = false;
- for(auto m : modules){
- auto fname = Json::requireString(m.toObject(),"foldername");
+ for (auto m : modules) {
+ auto fname = Json::requireString(m.toObject(), "foldername");
// FIXME: This does not work properly when a mod supports more than one mod loader, since
// they bundle the meta files for all of them in the same arquive, even when that version
// doesn't support the given mod loader.
- if(hasFabric){
- if(fname == "fabric.mod.json"){
+ if (hasFabric) {
+ if (fname == "fabric.mod.json") {
is_valid_fabric_version = true;
break;
}
- }
- else break;
+ } else
+ break;
// NOTE: Since we're not validating forge versions, we can just skip this loop.
}
- if(hasFabric && !is_valid_fabric_version)
- continue;
+ if (hasFabric && !is_valid_fabric_version) continue;
unsortedVersions.append(file);
}
- auto orderSortPredicate = [](const IndexedVersion & a, const IndexedVersion & b) -> bool
- {
- //dates are in RFC 3339 format
+ auto orderSortPredicate = [](const ModPlatform::IndexedVersion& a, const ModPlatform::IndexedVersion& b) -> bool {
+ // dates are in RFC 3339 format
return a.date > b.date;
};
std::sort(unsortedVersions.begin(), unsortedVersions.end(), orderSortPredicate);
diff --git a/launcher/modplatform/flame/FlameModIndex.h b/launcher/modplatform/flame/FlameModIndex.h
index 0293bb23..d3171d94 100644
--- a/launcher/modplatform/flame/FlameModIndex.h
+++ b/launcher/modplatform/flame/FlameModIndex.h
@@ -3,48 +3,18 @@
//
#pragma once
-#include <QList>
-#include <QMetaType>
-#include <QString>
-#include <QVector>
-#include <QNetworkAccessManager>
-#include <QObjectPtr.h>
-#include "net/NetJob.h"
-#include "BaseInstance.h"
-
-namespace FlameMod {
- struct ModpackAuthor {
- QString name;
- QString url;
- };
- struct IndexedVersion {
- int addonId;
- int fileId;
- QString version;
- QVector<QString> mcVersion;
- QString downloadUrl;
- QString date;
- QString fileName;
- };
+#include "modplatform/ModIndex.h"
- struct IndexedPack
- {
- int addonId;
- QString name;
- QString description;
- QList<ModpackAuthor> authors;
- QString logoName;
- QString logoUrl;
- QString websiteUrl;
-
- bool versionsLoaded = false;
- QVector<IndexedVersion> versions;
- };
+#include "BaseInstance.h"
+#include <QNetworkAccessManager>
- void loadIndexedPack(IndexedPack & m, QJsonObject & obj);
- void loadIndexedPackVersions(IndexedPack &pack, QJsonArray &arr, const shared_qobject_ptr<QNetworkAccessManager> &network, BaseInstance *inst);
+namespace FlameMod {
-}
+void loadIndexedPack(ModPlatform::IndexedPack& m, QJsonObject& obj);
+void loadIndexedPackVersions(ModPlatform::IndexedPack& pack,
+ QJsonArray& arr,
+ const shared_qobject_ptr<QNetworkAccessManager>& network,
+ BaseInstance* inst);
-Q_DECLARE_METATYPE(FlameMod::IndexedPack)
+} // namespace FlameMod
diff --git a/launcher/modplatform/helpers/NetworkModAPI.cpp b/launcher/modplatform/helpers/NetworkModAPI.cpp
new file mode 100644
index 00000000..6829b837
--- /dev/null
+++ b/launcher/modplatform/helpers/NetworkModAPI.cpp
@@ -0,0 +1,60 @@
+#include "NetworkModAPI.h"
+
+#include "ui/pages/modplatform/ModModel.h"
+
+#include "Application.h"
+#include "net/NetJob.h"
+
+void NetworkModAPI::searchMods(CallerType* caller, SearchArgs&& args) const
+{
+ auto netJob = new NetJob(QString("%1::Search").arg(caller->debugName()), APPLICATION->network());
+ auto searchUrl = getModSearchURL(args);
+
+ auto response = new QByteArray();
+ netJob->addNetAction(Net::Download::makeByteArray(QUrl(searchUrl), response));
+
+ QObject::connect(netJob, &NetJob::started, caller, [caller, netJob] { caller->setActiveJob(netJob); });
+ QObject::connect(netJob, &NetJob::failed, caller, &CallerType::searchRequestFailed);
+ QObject::connect(netJob, &NetJob::succeeded, caller, [caller, response] {
+ QJsonParseError parse_error{};
+ QJsonDocument doc = QJsonDocument::fromJson(*response, &parse_error);
+ if (parse_error.error != QJsonParseError::NoError) {
+ qWarning() << "Error while parsing JSON response from " << caller->debugName() << " at " << parse_error.offset
+ << " reason: " << parse_error.errorString();
+ qWarning() << *response;
+ return;
+ }
+
+ caller->searchRequestFinished(doc);
+ });
+
+ netJob->start();
+}
+
+void NetworkModAPI::getVersions(CallerType* caller, VersionSearchArgs&& args) const
+{
+ auto netJob = new NetJob(QString("%1::ModVersions(%2)").arg(caller->debugName()).arg(args.addonId), APPLICATION->network());
+ auto response = new QByteArray();
+
+ netJob->addNetAction(Net::Download::makeByteArray(getVersionsURL(args), response));
+
+ QObject::connect(netJob, &NetJob::succeeded, caller, [response, caller, args] {
+ QJsonParseError parse_error{};
+ QJsonDocument doc = QJsonDocument::fromJson(*response, &parse_error);
+ if (parse_error.error != QJsonParseError::NoError) {
+ qWarning() << "Error while parsing JSON response from " << caller->debugName() << " at " << parse_error.offset
+ << " reason: " << parse_error.errorString();
+ qWarning() << *response;
+ return;
+ }
+
+ caller->versionRequestSucceeded(doc, args.addonId);
+ });
+
+ QObject::connect(netJob, &NetJob::finished, caller, [response, netJob] {
+ netJob->deleteLater();
+ delete response;
+ });
+
+ netJob->start();
+}
diff --git a/launcher/modplatform/helpers/NetworkModAPI.h b/launcher/modplatform/helpers/NetworkModAPI.h
new file mode 100644
index 00000000..000620b2
--- /dev/null
+++ b/launcher/modplatform/helpers/NetworkModAPI.h
@@ -0,0 +1,13 @@
+#pragma once
+
+#include "modplatform/ModAPI.h"
+
+class NetworkModAPI : public ModAPI {
+ public:
+ void searchMods(CallerType* caller, SearchArgs&& args) const override;
+ void getVersions(CallerType* caller, VersionSearchArgs&& args) const override;
+
+ protected:
+ virtual auto getModSearchURL(SearchArgs& args) const -> QString = 0;
+ virtual auto getVersionsURL(VersionSearchArgs& args) const -> QString = 0;
+};
diff --git a/launcher/modplatform/modrinth/ModrinthAPI.h b/launcher/modplatform/modrinth/ModrinthAPI.h
new file mode 100644
index 00000000..30952e99
--- /dev/null
+++ b/launcher/modplatform/modrinth/ModrinthAPI.h
@@ -0,0 +1,73 @@
+#pragma once
+
+#include "modplatform/helpers/NetworkModAPI.h"
+
+#include <QDebug>
+
+class ModrinthAPI : public NetworkModAPI {
+ public:
+ inline auto getAuthorURL(const QString& name) const -> QString { return "https://modrinth.com/user/" + name; };
+
+ private:
+ inline auto getModSearchURL(SearchArgs& args) const -> QString override
+ {
+ if (!validateModLoader(args.mod_loader)) {
+ qWarning() << "Modrinth only have Forge and Fabric-compatible mods!";
+ return "";
+ }
+
+ return QString(
+ "https://api.modrinth.com/v2/search?"
+ "offset=%1&"
+ "limit=25&"
+ "query=%2&"
+ "index=%3&"
+ "facets=[[\"categories:%4\"],[\"versions:%5\"],[\"project_type:mod\"]]")
+ .arg(args.offset)
+ .arg(args.search)
+ .arg(args.sorting)
+ .arg(getModLoaderString(args.mod_loader))
+ .arg(args.version);
+ };
+
+ inline auto getVersionsURL(VersionSearchArgs& args) const -> QString override
+ {
+ return QString("https://api.modrinth.com/v2/project/%1/version?"
+ "game_versions=[%2]"
+ "loaders=[%3]")
+ .arg(args.addonId)
+ .arg(getGameVersionsString(args.mcVersions))
+ .arg(getModLoaderString(args.loader));
+ };
+
+ inline auto getGameVersionsString(QList<QString> mcVersions) const -> QString
+ {
+ QString s;
+ for(int i = 0; i < mcVersions.count(); i++){
+ s += mcVersions.at(i);
+ if(i < mcVersions.count() - 1)
+ s += ",";
+ }
+ return s;
+ }
+
+ inline auto getModLoaderString(ModLoaderType modLoader) const -> QString
+ {
+ switch (modLoader) {
+ case Any:
+ return "fabric, forge";
+ case Forge:
+ return "forge";
+ case Fabric:
+ return "fabric";
+ default:
+ return "";
+ }
+ }
+
+ inline auto validateModLoader(ModLoaderType modLoader) const -> bool
+ {
+ return modLoader == Any || modLoader == Forge || modLoader == Fabric;
+ }
+
+};
diff --git a/launcher/modplatform/modrinth/ModrinthPackIndex.cpp b/launcher/modplatform/modrinth/ModrinthPackIndex.cpp
index 9581ca04..a4e56d4f 100644
--- a/launcher/modplatform/modrinth/ModrinthPackIndex.cpp
+++ b/launcher/modplatform/modrinth/ModrinthPackIndex.cpp
@@ -1,14 +1,14 @@
-#include <QObject>
#include "ModrinthPackIndex.h"
+#include "ModrinthAPI.h"
#include "Json.h"
-#include "net/NetJob.h"
-#include "BaseInstance.h"
#include "minecraft/MinecraftInstance.h"
#include "minecraft/PackProfile.h"
+#include "net/NetJob.h"
+static ModrinthAPI api;
-void Modrinth::loadIndexedPack(Modrinth::IndexedPack & pack, QJsonObject & obj)
+void Modrinth::loadIndexedPack(ModPlatform::IndexedPack& pack, QJsonObject& obj)
{
pack.addonId = Json::requireString(obj, "project_id");
pack.name = Json::requireString(obj, "title");
@@ -16,35 +16,35 @@ void Modrinth::loadIndexedPack(Modrinth::IndexedPack & pack, QJsonObject & obj)
pack.description = Json::ensureString(obj, "description", "");
pack.logoUrl = Json::requireString(obj, "icon_url");
- pack.logoName = pack.addonId;
+ pack.logoName = pack.addonId.toString();
- Modrinth::ModpackAuthor modAuthor;
+ ModPlatform::ModpackAuthor modAuthor;
modAuthor.name = Json::requireString(obj, "author");
- modAuthor.url = "https://modrinth.com/user/"+modAuthor.name;
- pack.author = modAuthor;
+ modAuthor.url = api.getAuthorURL(modAuthor.name);
+ pack.authors.append(modAuthor);
}
-void Modrinth::loadIndexedPackVersions(Modrinth::IndexedPack & pack, QJsonArray & arr, const shared_qobject_ptr<QNetworkAccessManager>& network, BaseInstance * inst)
+void Modrinth::loadIndexedPackVersions(ModPlatform::IndexedPack& pack,
+ QJsonArray& arr,
+ const shared_qobject_ptr<QNetworkAccessManager>& network,
+ BaseInstance* inst)
{
- QVector<Modrinth::IndexedVersion> unsortedVersions;
- bool hasFabric = !((MinecraftInstance *)inst)->getPackProfile()->getComponentVersion("net.fabricmc.fabric-loader").isEmpty();
- QString mcVersion = ((MinecraftInstance *)inst)->getPackProfile()->getComponentVersion("net.minecraft");
+ QVector<ModPlatform::IndexedVersion> unsortedVersions;
+ QString mcVersion = (static_cast<MinecraftInstance*>(inst))->getPackProfile()->getComponentVersion("net.minecraft");
- for(auto versionIter: arr) {
+ for (auto versionIter : arr) {
auto obj = versionIter.toObject();
- Modrinth::IndexedVersion file;
- file.addonId = Json::requireString(obj,"project_id") ;
+ ModPlatform::IndexedVersion file;
+ file.addonId = Json::requireString(obj, "project_id");
file.fileId = Json::requireString(obj, "id");
file.date = Json::requireString(obj, "date_published");
auto versionArray = Json::requireArray(obj, "game_versions");
- if (versionArray.empty()) {
- continue;
- }
- for(auto mcVer : versionArray){
+ if (versionArray.empty()) { continue; }
+ for (auto mcVer : versionArray) {
file.mcVersion.append(mcVer.toString());
}
- auto loaders = Json::requireArray(obj,"loaders");
- for(auto loader : loaders){
+ auto loaders = Json::requireArray(obj, "loaders");
+ for (auto loader : loaders) {
file.loaders.append(loader.toString());
}
file.version = Json::requireString(obj, "name");
@@ -55,21 +55,11 @@ void Modrinth::loadIndexedPackVersions(Modrinth::IndexedPack & pack, QJsonArray
// Find correct file (needed in cases where one version may have multiple files)
// Will default to the last one if there's no primary (though I think Modrinth requires that
// at least one file is primary, idk)
- while (i < files.count()){
+ // NOTE: files.count() is 1-indexed, so we need to subtract 1 to become 0-indexed
+ while (i < files.count() - 1){
auto parent = files[i].toObject();
auto fileName = Json::requireString(parent, "filename");
- // Grab the correct mod loader
- if(hasFabric){
- if(fileName.contains("forge",Qt::CaseInsensitive)){
- i++;
- continue;
- }
- } else if(fileName.contains("fabric", Qt::CaseInsensitive)){
- i++;
- continue;
- }
-
// Grab the primary file, if available
if(Json::requireBoolean(parent, "primary"))
break;
@@ -78,16 +68,15 @@ void Modrinth::loadIndexedPackVersions(Modrinth::IndexedPack & pack, QJsonArray
}
auto parent = files[i].toObject();
- if(parent.contains("url")) {
+ if (parent.contains("url")) {
file.downloadUrl = Json::requireString(parent, "url");
file.fileName = Json::requireString(parent, "filename");
unsortedVersions.append(file);
}
}
- auto orderSortPredicate = [](const IndexedVersion & a, const IndexedVersion & b) -> bool
- {
- //dates are in RFC 3339 format
+ auto orderSortPredicate = [](const ModPlatform::IndexedVersion& a, const ModPlatform::IndexedVersion& b) -> bool {
+ // dates are in RFC 3339 format
return a.date > b.date;
};
std::sort(unsortedVersions.begin(), unsortedVersions.end(), orderSortPredicate);
diff --git a/launcher/modplatform/modrinth/ModrinthPackIndex.h b/launcher/modplatform/modrinth/ModrinthPackIndex.h
index 3a4cd270..fd17847a 100644
--- a/launcher/modplatform/modrinth/ModrinthPackIndex.h
+++ b/launcher/modplatform/modrinth/ModrinthPackIndex.h
@@ -1,48 +1,16 @@
#pragma once
-#include <QList>
-#include <QMetaType>
-#include <QString>
-#include <QVector>
-#include <QNetworkAccessManager>
-#include <QObjectPtr.h>
-#include "net/NetJob.h"
+#include "modplatform/ModIndex.h"
+
#include "BaseInstance.h"
+#include <QNetworkAccessManager>
namespace Modrinth {
-struct ModpackAuthor {
- QString name;
- QString url;
-};
-
-struct IndexedVersion {
- QString addonId;
- QString fileId;
- QString version;
- QVector<QString> mcVersion;
- QString downloadUrl;
- QString date;
- QString fileName;
- QVector<QString> loaders;
-};
-
-struct IndexedPack
-{
- QString addonId;
- QString name;
- QString description;
- ModpackAuthor author;
- QString logoName;
- QString logoUrl;
- QString websiteUrl;
-
- bool versionsLoaded = false;
- QVector<IndexedVersion> versions;
-};
-
-void loadIndexedPack(IndexedPack & m, QJsonObject & obj);
-void loadIndexedPackVersions(IndexedPack &pack, QJsonArray &arr, const shared_qobject_ptr<QNetworkAccessManager> &network, BaseInstance *inst);
-}
+void loadIndexedPack(ModPlatform::IndexedPack& m, QJsonObject& obj);
+void loadIndexedPackVersions(ModPlatform::IndexedPack& pack,
+ QJsonArray& arr,
+ const shared_qobject_ptr<QNetworkAccessManager>& network,
+ BaseInstance* inst);
-Q_DECLARE_METATYPE(Modrinth::IndexedPack)
+} // namespace Modrinth