feat: add changelog to mod providers
The Modrinth changelog is fairly straight-forward, as it's given to us directly with the API call we already did. Flame, on the other hand, requires us to do another call to get the changelog, so it can introduce quite a heavy performance impact. This way, we make it optional to get such changelog. Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
@ -7,6 +7,7 @@
|
||||
#include "net/NetJob.h"
|
||||
|
||||
static ModPlatform::ProviderCapabilities ProviderCaps;
|
||||
static FlameAPI api;
|
||||
|
||||
void FlameMod::loadIndexedPack(ModPlatform::IndexedPack& pack, QJsonObject& obj)
|
||||
{
|
||||
@ -91,7 +92,7 @@ void FlameMod::loadIndexedPackVersions(ModPlatform::IndexedPack& pack,
|
||||
pack.versionsLoaded = true;
|
||||
}
|
||||
|
||||
auto FlameMod::loadIndexedPackVersion(QJsonObject& obj) -> ModPlatform::IndexedVersion
|
||||
auto FlameMod::loadIndexedPackVersion(QJsonObject& obj, bool load_changelog) -> ModPlatform::IndexedVersion
|
||||
{
|
||||
auto versionArray = Json::requireArray(obj, "gameVersions");
|
||||
if (versionArray.isEmpty()) {
|
||||
@ -124,5 +125,9 @@ auto FlameMod::loadIndexedPackVersion(QJsonObject& obj) -> ModPlatform::IndexedV
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(load_changelog)
|
||||
file.changelog = api.getModFileChangelog(file.addonId.toInt(), file.fileId.toInt());
|
||||
|
||||
return file;
|
||||
}
|
||||
|
Reference in New Issue
Block a user