revert: remove CurseForge workaround for packs too
Partial revert. Handles missing download URLs.
This commit is contained in:
parent
7f73e57c67
commit
938cae1130
@ -65,16 +65,12 @@ 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.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));
|
||||
|
||||
// only add if we have a download URL (third party distribution is enabled)
|
||||
if (!file.downloadUrl.isEmpty()) {
|
||||
unsortedVersions.append(file);
|
||||
}
|
||||
unsortedVersions.append(file);
|
||||
}
|
||||
|
||||
auto orderSortPredicate = [](const IndexedVersion& a, const IndexedVersion& b) -> bool { return a.fileId > b.fileId; };
|
||||
|
@ -18,7 +18,6 @@ struct IndexedVersion {
|
||||
QString version;
|
||||
QString mcVersion;
|
||||
QString downloadUrl;
|
||||
QString fileName;
|
||||
};
|
||||
|
||||
struct IndexedPack
|
||||
|
Loading…
Reference in New Issue
Block a user