Updated authors string in modlist

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2023-06-24 20:22:18 +03:00
parent 81c1a95166
commit df932c6587
No known key found for this signature in database
GPG Key ID: 55EF5DA53DB36318

View File

@ -36,7 +36,7 @@
#include "modplatform/helpers/HashUtils.h"
#include "tasks/Task.h"
const QString FlamePackExportTask::TEMPLATE = "<li><a href={url}>{name} (by {authors})</a></li>";
const QString FlamePackExportTask::TEMPLATE = "<li><a href={url}>{name}{authors}</a></li>";
FlamePackExportTask::FlamePackExportTask(const QString& name,
const QString& version,
@ -338,11 +338,12 @@ void FlamePackExportTask::buildZip()
QString content = "";
for (auto mod : resolvedFiles) {
if (mod.isMod) {
content += QString(TEMPLATE)
.replace("{name}", mod.name)
.replace("{url}", ModPlatform::getMetaURL(ModPlatform::ResourceProvider::FLAME, mod.slug))
.replace("{authors}", mod.authors) +
"\n";
auto line = QString(TEMPLATE)
.replace("{name}", mod.name)
.replace("{url}", ModPlatform::getMetaURL(ModPlatform::ResourceProvider::FLAME, mod.slug));
if (!mod.authors.isEmpty())
line = line.replace("{authors}", QString(" (by {%1})").arg(mod.authors));
content += line + "\n";
}
}
content = "<ul>" + content + "</ul>";