Merge pull request #634 from flowln/donate_links

More links for CF / Modrinth mods / modpacks
This commit is contained in:
Ezekiel Smith
2022-06-14 23:52:00 +10:00
committed by GitHub
23 changed files with 370 additions and 49 deletions

View File

@ -96,6 +96,11 @@ void ListModel::performPaginatedSearch()
this, { nextSearchOffset, currentSearchTerm, getSorts()[currentSort], profile->getModLoaders(), getMineVersions() });
}
void ListModel::requestModInfo(ModPlatform::IndexedPack& current)
{
m_parent->apiProvider()->getModInfo(this, current);
}
void ListModel::refresh()
{
if (jobPtr) {
@ -242,6 +247,21 @@ void ListModel::searchRequestFailed(QString reason)
}
}
void ListModel::infoRequestFinished(QJsonDocument& doc, ModPlatform::IndexedPack& pack)
{
qDebug() << "Loading mod info";
try {
auto obj = Json::requireObject(doc);
loadExtraPackInfo(pack, obj);
} catch (const JSONValidationError& e) {
qDebug() << doc;
qWarning() << "Error while reading " << debugName() << " mod info: " << e.cause();
}
m_parent->updateUi();
}
void ListModel::versionRequestSucceeded(QJsonDocument doc, QString addonId)
{
auto& current = m_parent->getCurrent();