diff options
author | timoreo22 <timo.oreo34@gmail.com> | 2022-05-21 06:34:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-21 06:34:43 +0200 |
commit | 92e8aaf36f72b7527322add169b253d0698939d0 (patch) | |
tree | f90ccb0973386de577f6f9d08064ddee53a74f15 /launcher/modplatform/flame/FlameModIndex.cpp | |
parent | 88a93945d4c9a11bf53016133335d359b819585e (diff) | |
parent | 3b4b34b3695e655f591347754a724804bea96d71 (diff) | |
download | PrismLauncher-92e8aaf36f72b7527322add169b253d0698939d0.tar.gz PrismLauncher-92e8aaf36f72b7527322add169b253d0698939d0.tar.bz2 PrismLauncher-92e8aaf36f72b7527322add169b253d0698939d0.zip |
Merge pull request #608 from timoreo22/feature/curseforge-fix
Very Temporary Fix for curseforge
Diffstat (limited to 'launcher/modplatform/flame/FlameModIndex.cpp')
-rw-r--r-- | launcher/modplatform/flame/FlameModIndex.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/launcher/modplatform/flame/FlameModIndex.cpp b/launcher/modplatform/flame/FlameModIndex.cpp index ba0824cf..9846b156 100644 --- a/launcher/modplatform/flame/FlameModIndex.cpp +++ b/launcher/modplatform/flame/FlameModIndex.cpp @@ -56,8 +56,15 @@ void FlameMod::loadIndexedPackVersions(ModPlatform::IndexedPack& pack, file.fileId = Json::requireInteger(obj, "id"); file.date = Json::requireString(obj, "fileDate"); file.version = Json::requireString(obj, "displayName"); - file.downloadUrl = Json::requireString(obj, "downloadUrl"); file.fileName = Json::requireString(obj, "fileName"); + file.downloadUrl = Json::ensureString(obj, "downloadUrl", ""); + if(file.downloadUrl.isEmpty()){ + //FIXME : HACK, MAY NOT WORK FOR LONG + file.downloadUrl = QString("https://media.forgecdn.net/files/%1/%2/%3") + .arg(QString::number(QString::number(file.fileId.toInt()).leftRef(4).toInt()) + ,QString::number(QString::number(file.fileId.toInt()).rightRef(3).toInt()) + ,QUrl::toPercentEncoding(file.fileName)); + } unsortedVersions.append(file); } |