diff options
author | Sefa Eyeoglu <contact@scrumplex.net> | 2022-06-12 10:50:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-12 10:50:57 +0200 |
commit | c4f2e3a95584d9c50544a978a83650f8f83551fa (patch) | |
tree | 0a9edd553ebe4de68a671567e69e4c7e8c1ead9e /launcher/modplatform | |
parent | 91301ec7fe5c6d78d7143be3790bd0bbf8c93e91 (diff) | |
parent | 37160f973f1d2fed450f40f38a55b8445787c4bd (diff) | |
download | PrismLauncher-c4f2e3a95584d9c50544a978a83650f8f83551fa.tar.gz PrismLauncher-c4f2e3a95584d9c50544a978a83650f8f83551fa.tar.bz2 PrismLauncher-c4f2e3a95584d9c50544a978a83650f8f83551fa.zip |
Merge pull request #771 from flowln/modrinth_multiple_downloads
Diffstat (limited to 'launcher/modplatform')
-rw-r--r-- | launcher/modplatform/modrinth/ModrinthPackManifest.cpp | 16 | ||||
-rw-r--r-- | launcher/modplatform/modrinth/ModrinthPackManifest.h | 7 |
2 files changed, 3 insertions, 20 deletions
diff --git a/launcher/modplatform/modrinth/ModrinthPackManifest.cpp b/launcher/modplatform/modrinth/ModrinthPackManifest.cpp index 33116231..cc12f62f 100644 --- a/launcher/modplatform/modrinth/ModrinthPackManifest.cpp +++ b/launcher/modplatform/modrinth/ModrinthPackManifest.cpp @@ -95,19 +95,6 @@ void loadIndexedVersions(Modpack& pack, QJsonDocument& doc) pack.versionsLoaded = true; } -auto validateDownloadUrl(QUrl url) -> bool -{ - static QSet<QString> domainWhitelist{ - "cdn.modrinth.com", - "github.com", - "raw.githubusercontent.com", - "gitlab.com" - }; - - auto domain = url.host(); - return domainWhitelist.contains(domain); -} - auto loadIndexedVersion(QJsonObject &obj) -> ModpackVersion { ModpackVersion file; @@ -137,9 +124,6 @@ auto loadIndexedVersion(QJsonObject &obj) -> ModpackVersion auto url = Json::requireString(parent, "url"); - if(!validateDownloadUrl(url)) - continue; - file.download_url = url; if(is_primary) break; diff --git a/launcher/modplatform/modrinth/ModrinthPackManifest.h b/launcher/modplatform/modrinth/ModrinthPackManifest.h index e5fc9a70..b2083f57 100644 --- a/launcher/modplatform/modrinth/ModrinthPackManifest.h +++ b/launcher/modplatform/modrinth/ModrinthPackManifest.h @@ -40,6 +40,7 @@ #include <QByteArray> #include <QCryptographicHash> +#include <QQueue> #include <QString> #include <QUrl> #include <QVector> @@ -48,14 +49,12 @@ class MinecraftInstance; namespace Modrinth { -struct File -{ +struct File { QString path; QCryptographicHash::Algorithm hashAlgorithm; QByteArray hash; - // TODO: should this support multiple download URLs, like the JSON does? - QUrl download; + QQueue<QUrl> downloads; }; struct ModpackExtra { |