Do the url trick on initial modpack download too
This commit is contained in:
parent
92e8aaf36f
commit
c04adf7452
@ -65,7 +65,15 @@ void Flame::loadIndexedPackVersions(Flame::IndexedPack& pack, QJsonArray& arr)
|
||||
// pick the latest version supported
|
||||
file.mcVersion = versionArray[0].toString();
|
||||
file.version = Json::requireString(version, "displayName");
|
||||
file.downloadUrl = Json::requireString(version, "downloadUrl");
|
||||
file.fileName = Json::requireString(version, "fileName");
|
||||
file.downloadUrl = Json::ensureString(version, "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).leftRef(4).toInt())
|
||||
,QString::number(QString::number(file.fileId).rightRef(3).toInt())
|
||||
,QUrl::toPercentEncoding(file.fileName));
|
||||
}
|
||||
unsortedVersions.append(file);
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@ struct IndexedVersion {
|
||||
QString version;
|
||||
QString mcVersion;
|
||||
QString downloadUrl;
|
||||
QString fileName;
|
||||
};
|
||||
|
||||
struct IndexedPack
|
||||
|
Loading…
Reference in New Issue
Block a user