refactor: move url creation for mods to modplatform/
Moves all things related to creating the URLs of the mod platforms that go to network tasks to a single place, so that: 1. Maintaining and fixing eventual issues is more straightforward. 2. Makes it possible to factor out more common code between the different modplatform pages
This commit is contained in:
@ -1,10 +1,13 @@
|
||||
#include "ModrinthPackIndex.h"
|
||||
#include "ModrinthAPI.h"
|
||||
|
||||
#include "Json.h"
|
||||
#include "minecraft/MinecraftInstance.h"
|
||||
#include "minecraft/PackProfile.h"
|
||||
#include "net/NetJob.h"
|
||||
|
||||
static ModrinthAPI api;
|
||||
|
||||
void Modrinth::loadIndexedPack(ModPlatform::IndexedPack& pack, QJsonObject& obj)
|
||||
{
|
||||
pack.addonId = Json::requireString(obj, "project_id");
|
||||
@ -17,7 +20,7 @@ void Modrinth::loadIndexedPack(ModPlatform::IndexedPack& pack, QJsonObject& obj)
|
||||
|
||||
ModPlatform::ModpackAuthor modAuthor;
|
||||
modAuthor.name = Json::requireString(obj, "author");
|
||||
modAuthor.url = "https://modrinth.com/user/" + modAuthor.name;
|
||||
modAuthor.url = api.getAuthorURL(modAuthor.name);
|
||||
pack.authors.append(modAuthor);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user