diff options
author | Trial97 <alexandru.tripon97@gmail.com> | 2023-06-25 10:41:29 +0300 |
---|---|---|
committer | Trial97 <alexandru.tripon97@gmail.com> | 2023-06-25 10:41:29 +0300 |
commit | ce4a86fbcd0c891472b842e76066d285de3aef7b (patch) | |
tree | 33b246e0ac4d5d81aca7652d495ea2439f308a1c /launcher/modplatform | |
parent | 54d7477679d4be05ce69dfe7d3ff21b0de46e8af (diff) | |
download | PrismLauncher-ce4a86fbcd0c891472b842e76066d285de3aef7b.tar.gz PrismLauncher-ce4a86fbcd0c891472b842e76066d285de3aef7b.tar.bz2 PrismLauncher-ce4a86fbcd0c891472b842e76066d285de3aef7b.zip |
Made custom url function
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
Diffstat (limited to 'launcher/modplatform')
-rw-r--r-- | launcher/modplatform/ModIndex.cpp | 8 | ||||
-rw-r--r-- | launcher/modplatform/ModIndex.h | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/launcher/modplatform/ModIndex.cpp b/launcher/modplatform/ModIndex.cpp index 6a507caf..a1c4d891 100644 --- a/launcher/modplatform/ModIndex.cpp +++ b/launcher/modplatform/ModIndex.cpp @@ -70,11 +70,17 @@ auto ProviderCapabilities::hash(ResourceProvider p, QIODevice* device, QString t } QCryptographicHash hash(algo); - if(!hash.addData(device)) + if (!hash.addData(device)) qCritical() << "Failed to read JAR to create hash!"; Q_ASSERT(hash.result().length() == hash.hashLength(algo)); return { hash.result().toHex() }; } +QString getMetaURL(ResourceProvider provider, QVariant projectID) +{ + return ((provider == ModPlatform::ResourceProvider::FLAME) ? "https://www.curseforge.com/projects/" : "https://modrinth.com/mod/") + + projectID.toString(); +} + } // namespace ModPlatform diff --git a/launcher/modplatform/ModIndex.h b/launcher/modplatform/ModIndex.h index 3b0a03a1..3f51e700 100644 --- a/launcher/modplatform/ModIndex.h +++ b/launcher/modplatform/ModIndex.h @@ -144,6 +144,7 @@ inline auto getOverrideDeps() -> QList<OverrideDep> { "qvIfYCYJ", "P7dR8mSH", "API", ModPlatform::ResourceProvider::MODRINTH }, { "lwVhp9o5", "Ha28R6CL", "KotlinLibraries", ModPlatform::ResourceProvider::MODRINTH } }; }; +QString getMetaURL(ResourceProvider provider, QVariant projectID); } // namespace ModPlatform |