fix: Have the URL be the project URL itself

(I think, doesn't seem to work for the waffle though, probably because
of the staging API :/)
This commit is contained in:
flow 2022-05-14 21:47:35 -03:00
parent 5ea8cec16f
commit 9899a0e098
No known key found for this signature in database
GPG Key ID: 8D0F221F0A59F469
3 changed files with 3 additions and 1 deletions

View File

@ -35,6 +35,7 @@ void loadIndexedPack(Modpack& pack, QJsonObject& obj)
void loadIndexedInfo(Modpack& pack, QJsonObject& obj)
{
pack.extra.body = Json::ensureString(obj, "body");
pack.extra.projectUrl = QString("https://modrinth.com/modpack/%1").arg(Json::ensureString(obj, "slug"));
pack.extra.sourceUrl = Json::ensureString(obj, "source_url");
pack.extra.wikiUrl = Json::ensureString(obj, "wiki_url");

View File

@ -39,6 +39,7 @@ struct File
struct ModpackExtra {
QString body;
QString projectUrl;
QString sourceUrl;
QString wikiUrl;
};

View File

@ -219,7 +219,7 @@ void ModrinthPage::updateUI()
if (current.extra.sourceUrl.isEmpty())
text = current.name;
else
text = "<a href=\"" + current.extra.sourceUrl + "\">" + current.name + "</a>";
text = "<a href=\"" + current.extra.projectUrl + "\">" + current.name + "</a>";
if (!current.authors.empty()) {
// TODO: Implement multiple authors with links