diff options
author | flow <thiagodonato300@gmail.com> | 2022-03-02 23:01:23 -0300 |
---|---|---|
committer | flow <thiagodonato300@gmail.com> | 2022-03-02 23:13:04 -0300 |
commit | 2d68308d4920be4c28a73d7646814765eee7b7a2 (patch) | |
tree | ac0c9abf5a1f33bc13b8f885070904e7e7bfe43d /launcher/modplatform/modrinth/ModrinthPackIndex.cpp | |
parent | 0dd1c26cf3cd68cd83f5d9da6cf34d4aa3f30db2 (diff) | |
download | PrismLauncher-2d68308d4920be4c28a73d7646814765eee7b7a2.tar.gz PrismLauncher-2d68308d4920be4c28a73d7646814765eee7b7a2.tar.bz2 PrismLauncher-2d68308d4920be4c28a73d7646814765eee7b7a2.zip |
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
Diffstat (limited to 'launcher/modplatform/modrinth/ModrinthPackIndex.cpp')
-rw-r--r-- | launcher/modplatform/modrinth/ModrinthPackIndex.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/launcher/modplatform/modrinth/ModrinthPackIndex.cpp b/launcher/modplatform/modrinth/ModrinthPackIndex.cpp index a59186f7..02aac34d 100644 --- a/launcher/modplatform/modrinth/ModrinthPackIndex.cpp +++ b/launcher/modplatform/modrinth/ModrinthPackIndex.cpp @@ -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); } |