aboutsummaryrefslogtreecommitdiff
path: root/launcher
diff options
context:
space:
mode:
authortimoreo <timo.oreo34@gmail.com>2022-05-20 22:00:38 +0200
committertimoreo <timo.oreo34@gmail.com>2022-05-20 22:00:38 +0200
commit30b56dbcbd3bb7d61210405a469c7efb28581904 (patch)
tree8f0564e8fed2cfa50e9612f757d100d89fa205ed /launcher
parent6afe59e76b6a5d44b8706e8e030ecd0396dc8801 (diff)
downloadPrismLauncher-30b56dbcbd3bb7d61210405a469c7efb28581904.tar.gz
PrismLauncher-30b56dbcbd3bb7d61210405a469c7efb28581904.tar.bz2
PrismLauncher-30b56dbcbd3bb7d61210405a469c7efb28581904.zip
Port temp fix to mods too
Diffstat (limited to 'launcher')
-rw-r--r--launcher/modplatform/flame/FlameModIndex.cpp9
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);
}