fix(ModUpdater): ensure instead of require icon_url
The spec says that this can be null, and indeed some mods have it set to null, and should still be considered as valid. Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
parent
9407596b12
commit
c95c81d42f
@ -27,6 +27,7 @@
|
|||||||
static ModrinthAPI api;
|
static ModrinthAPI api;
|
||||||
static ModPlatform::ProviderCapabilities ProviderCaps;
|
static ModPlatform::ProviderCapabilities ProviderCaps;
|
||||||
|
|
||||||
|
// https://docs.modrinth.com/api-spec/#tag/projects/operation/getProject
|
||||||
void Modrinth::loadIndexedPack(ModPlatform::IndexedPack& pack, QJsonObject& obj)
|
void Modrinth::loadIndexedPack(ModPlatform::IndexedPack& pack, QJsonObject& obj)
|
||||||
{
|
{
|
||||||
pack.addonId = Json::ensureString(obj, "project_id");
|
pack.addonId = Json::ensureString(obj, "project_id");
|
||||||
@ -44,7 +45,7 @@ void Modrinth::loadIndexedPack(ModPlatform::IndexedPack& pack, QJsonObject& obj)
|
|||||||
|
|
||||||
pack.description = Json::ensureString(obj, "description", "");
|
pack.description = Json::ensureString(obj, "description", "");
|
||||||
|
|
||||||
pack.logoUrl = Json::requireString(obj, "icon_url");
|
pack.logoUrl = Json::ensureString(obj, "icon_url", "");
|
||||||
pack.logoName = pack.addonId.toString();
|
pack.logoName = pack.addonId.toString();
|
||||||
|
|
||||||
ModPlatform::ModpackAuthor modAuthor;
|
ModPlatform::ModpackAuthor modAuthor;
|
||||||
|
Loading…
Reference in New Issue
Block a user