Merge pull request #395 from HarryPeach/develop

This commit is contained in:
dada513 2022-04-05 18:01:00 +02:00 committed by GitHub
commit 8732bea99b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,7 +12,13 @@ void Modrinth::loadIndexedPack(ModPlatform::IndexedPack& pack, QJsonObject& obj)
{
pack.addonId = Json::requireString(obj, "project_id");
pack.name = Json::requireString(obj, "title");
pack.websiteUrl = "https://modrinth.com/mod/" + Json::ensureString(obj, "slug", "");
QString slug = Json::ensureString(obj, "slug", "");
if (!slug.isEmpty())
pack.websiteUrl = "https://modrinth.com/mod/" + Json::ensureString(obj, "slug", "");
else
pack.websiteUrl = "";
pack.description = Json::ensureString(obj, "description", "");
pack.logoUrl = Json::requireString(obj, "icon_url");