aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--launcher/modplatform/modrinth/ModrinthPackIndex.cpp8
-rw-r--r--launcher/modplatform/modrinth/ModrinthPackIndex.h2
-rw-r--r--launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp16
3 files changed, 6 insertions, 20 deletions
diff --git a/launcher/modplatform/modrinth/ModrinthPackIndex.cpp b/launcher/modplatform/modrinth/ModrinthPackIndex.cpp
index 8d47699b..a546eb7c 100644
--- a/launcher/modplatform/modrinth/ModrinthPackIndex.cpp
+++ b/launcher/modplatform/modrinth/ModrinthPackIndex.cpp
@@ -18,10 +18,10 @@ void Modrinth::loadIndexedPack(Modrinth::IndexedPack & pack, QJsonObject & obj)
pack.logoUrl = Json::requireString(obj, "icon_url");
pack.logoName = pack.addonId;
- Modrinth::ModpackAuthor packAuthor;
- packAuthor.name = Json::requireString(obj, "author");
- packAuthor.url = Json::requireString(obj, "author_url");
- pack.authors.append(packAuthor); //TODO delete this ? only one author ever exists
+ Modrinth::ModpackAuthor modAuthor;
+ modAuthor.name = Json::requireString(obj, "author");
+ modAuthor.url = Json::requireString(obj, "author_url");
+ pack.author = modAuthor;
}
void Modrinth::loadIndexedPackVersions(Modrinth::IndexedPack & pack, QJsonArray & arr, const shared_qobject_ptr<QNetworkAccessManager>& network, BaseInstance * inst)
diff --git a/launcher/modplatform/modrinth/ModrinthPackIndex.h b/launcher/modplatform/modrinth/ModrinthPackIndex.h
index 01ae4b44..3a4cd270 100644
--- a/launcher/modplatform/modrinth/ModrinthPackIndex.h
+++ b/launcher/modplatform/modrinth/ModrinthPackIndex.h
@@ -32,7 +32,7 @@ struct IndexedPack
QString addonId;
QString name;
QString description;
- QList<ModpackAuthor> authors;
+ ModpackAuthor author;
QString logoName;
QString logoUrl;
QString websiteUrl;
diff --git a/launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp b/launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp
index d0319984..61912cd7 100644
--- a/launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp
+++ b/launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp
@@ -90,21 +90,7 @@ void ModrinthPage::onSelectionChanged(QModelIndex first, QModelIndex second)
text = name;
else
text = "<a href=\"" + current.websiteUrl + "\">" + name + "</a>";
- if (!current.authors.empty()) {
- auto authorToStr = [](Modrinth::ModpackAuthor & author) {
- if(author.url.isEmpty()) {
- return author.name;
- }
- return QString("<a href=\"%1\">%2</a>").arg(author.url, author.name);
- };
- QStringList authorStrs;
- for(auto & author: current.authors) {
- authorStrs.push_back(authorToStr(author));
- }
- text += "<br>" + tr(" by ") + authorStrs.join(", ");
- }
- text += "<br><br>";
-
+ text += "<br>"+ tr(" by ") + "<a href=\""+current.author.url+"\">"+current.author.name+"</a><br><br>";
ui->packDescription->setHtml(text + current.description);
if (!current.versionsLoaded)