2022-01-14 14:13:42 +05:30
|
|
|
#include "ModrinthModel.h"
|
|
|
|
|
2022-03-08 03:59:59 +05:30
|
|
|
#include "modplatform/modrinth/ModrinthPackIndex.h"
|
|
|
|
|
2022-01-14 14:13:42 +05:30
|
|
|
namespace Modrinth {
|
|
|
|
|
2022-03-08 19:42:35 +05:30
|
|
|
// NOLINTNEXTLINE(modernize-avoid-c-arrays)
|
2022-03-08 03:59:59 +05:30
|
|
|
const char* ListModel::sorts[5]{ "relevance", "downloads", "follows", "updated", "newest" };
|
|
|
|
|
|
|
|
void ListModel::loadIndexedPack(ModPlatform::IndexedPack& m, QJsonObject& obj)
|
|
|
|
{
|
|
|
|
Modrinth::loadIndexedPack(m, obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
void ListModel::loadIndexedPackVersions(ModPlatform::IndexedPack& m, QJsonArray& arr)
|
|
|
|
{
|
|
|
|
Modrinth::loadIndexedPackVersions(m, arr, APPLICATION->network(), m_parent->m_instance);
|
2022-03-08 04:25:20 +05:30
|
|
|
}
|
2022-03-08 03:59:59 +05:30
|
|
|
|
2022-03-08 19:42:35 +05:30
|
|
|
auto ListModel::documentToArray(QJsonDocument& obj) const -> QJsonArray
|
2022-03-08 03:59:59 +05:30
|
|
|
{
|
|
|
|
return obj.object().value("hits").toArray();
|
|
|
|
}
|
2022-03-03 07:31:23 +05:30
|
|
|
|
2022-03-03 05:47:10 +05:30
|
|
|
} // namespace Modrinth
|