Updated url function
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
df932c6587
commit
f0e4e07c05
@ -170,7 +170,7 @@ auto Mod::metaurl() const -> QString
|
|||||||
{
|
{
|
||||||
if (metadata() == nullptr)
|
if (metadata() == nullptr)
|
||||||
return homeurl();
|
return homeurl();
|
||||||
return ModPlatform::getMetaURL(metadata()->provider, metadata()->slug);
|
return ModPlatform::getMetaURL(metadata()->provider, metadata()->project_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
auto Mod::description() const -> QString
|
auto Mod::description() const -> QString
|
||||||
|
@ -77,11 +77,10 @@ auto ProviderCapabilities::hash(ResourceProvider p, QIODevice* device, QString t
|
|||||||
return { hash.result().toHex() };
|
return { hash.result().toHex() };
|
||||||
}
|
}
|
||||||
|
|
||||||
QString getMetaURL(ResourceProvider provider, QString slug)
|
QString getMetaURL(ResourceProvider provider, QVariant projectID)
|
||||||
{
|
{
|
||||||
return ((provider == ModPlatform::ResourceProvider::FLAME) ? "https://www.curseforge.com/minecraft/mc-mods/"
|
return ((provider == ModPlatform::ResourceProvider::FLAME) ? "https://www.curseforge.com/projects/" : "https://modrinth.com/mod/") +
|
||||||
: "https://modrinth.com/mod/") +
|
projectID.toString();
|
||||||
slug.remove(".pw.toml");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace ModPlatform
|
} // namespace ModPlatform
|
||||||
|
@ -128,7 +128,7 @@ struct IndexedPack {
|
|||||||
return std::any_of(versions.constBegin(), versions.constEnd(), [](auto const& v) { return v.is_currently_selected; });
|
return std::any_of(versions.constBegin(), versions.constEnd(), [](auto const& v) { return v.is_currently_selected; });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
QString getMetaURL(ResourceProvider provider, QString slug);
|
QString getMetaURL(ResourceProvider provider, QVariant projectID);
|
||||||
|
|
||||||
struct OverrideDep {
|
struct OverrideDep {
|
||||||
QString quilt;
|
QString quilt;
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
#include "modplatform/helpers/HashUtils.h"
|
#include "modplatform/helpers/HashUtils.h"
|
||||||
#include "tasks/Task.h"
|
#include "tasks/Task.h"
|
||||||
|
|
||||||
const QString FlamePackExportTask::TEMPLATE = "<li><a href={url}>{name}{authors}</a></li>";
|
const QString FlamePackExportTask::TEMPLATE = "<li><a href={url}>{name}{authors}</a></li>\n";
|
||||||
|
|
||||||
FlamePackExportTask::FlamePackExportTask(const QString& name,
|
FlamePackExportTask::FlamePackExportTask(const QString& name,
|
||||||
const QString& version,
|
const QString& version,
|
||||||
@ -338,12 +338,10 @@ void FlamePackExportTask::buildZip()
|
|||||||
QString content = "";
|
QString content = "";
|
||||||
for (auto mod : resolvedFiles) {
|
for (auto mod : resolvedFiles) {
|
||||||
if (mod.isMod) {
|
if (mod.isMod) {
|
||||||
auto line = QString(TEMPLATE)
|
content += QString(TEMPLATE)
|
||||||
.replace("{name}", mod.name)
|
.replace("{name}", mod.name)
|
||||||
.replace("{url}", ModPlatform::getMetaURL(ModPlatform::ResourceProvider::FLAME, mod.slug));
|
.replace("{url}", ModPlatform::getMetaURL(ModPlatform::ResourceProvider::FLAME, mod.addonId))
|
||||||
if (!mod.authors.isEmpty())
|
.replace("{authors}", !mod.authors.isEmpty() ? QString(" (by {%1})").arg(mod.authors) : "");
|
||||||
line = line.replace("{authors}", QString(" (by {%1})").arg(mod.authors));
|
|
||||||
content += line + "\n";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
content = "<ul>" + content + "</ul>";
|
content = "<ul>" + content + "</ul>";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user