removed some duplicate code
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
@@ -5,12 +5,14 @@
|
||||
#pragma once
|
||||
|
||||
#include "BuildConfig.h"
|
||||
#include "Json.h"
|
||||
#include "modplatform/ModIndex.h"
|
||||
#include "modplatform/helpers/NetworkResourceAPI.h"
|
||||
#include "modplatform/ResourceAPI.h"
|
||||
#include "modplatform/modrinth/ModrinthPackIndex.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
class ModrinthAPI : public NetworkResourceAPI {
|
||||
class ModrinthAPI : public ResourceAPI {
|
||||
public:
|
||||
Task::Ptr currentVersion(QString hash, QString hash_format, std::shared_ptr<QByteArray> response);
|
||||
|
||||
@@ -214,4 +216,12 @@ class ModrinthAPI : public NetworkResourceAPI {
|
||||
.arg(mapMCVersionToModrinth(args.mcVersion))
|
||||
.arg(getModLoaderStrings(args.loader).join("\",\""));
|
||||
};
|
||||
|
||||
QJsonArray documentToArray(QJsonDocument& obj) const override { return obj.object().value("hits").toArray(); }
|
||||
void loadIndexedPack(ModPlatform::IndexedPack& m, QJsonObject& obj) const override { Modrinth::loadIndexedPack(m, obj); }
|
||||
ModPlatform::IndexedVersion loadIndexedPackVersion(QJsonObject& obj, ModPlatform::ResourceType) const override
|
||||
{
|
||||
return Modrinth::loadIndexedPackVersion(obj);
|
||||
};
|
||||
void loadExtraPackInfo(ModPlatform::IndexedPack& m, QJsonObject& obj) const override { Modrinth::loadExtraPackData(m, obj); }
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user