revert: remove CurseForge workaround

We have been asked by CurseForge to remove this workaround as it
violates their terms of service. This is just a partial revert, as the
UI changes were otherwise unrelated.

This reverts commit 92e8aaf36f72b7527322add169b253d0698939d0, reversing
changes made to 88a93945d4c9a11bf53016133335d359b819585e.
This commit is contained in:
Sefa Eyeoglu
2022-05-22 22:04:24 +02:00
parent 7d91db607f
commit cb69869836
3 changed files with 7 additions and 33 deletions

View File

@ -71,6 +71,11 @@ bool Flame::File::parseFromBytes(const QByteArray& bytes)
fileName = Json::requireString(obj, "fileName");
QString rawUrl = Json::requireString(obj, "downloadUrl");
url = QUrl(rawUrl, QUrl::TolerantMode);
if (!url.isValid()) {
throw JSONValidationError(QString("Invalid URL: %1").arg(rawUrl));
}
// This is a piece of a Flame project JSON pulled out into the file metadata (here) for convenience
// It is also optional
type = File::Type::SingleFile;
@ -82,17 +87,7 @@ bool Flame::File::parseFromBytes(const QByteArray& bytes)
// this is probably a mod, dunno what else could modpacks download
targetFolder = "mods";
}
QString rawUrl = Json::ensureString(obj, "downloadUrl");
if(rawUrl.isEmpty()){
//either there somehow is an emtpy string as a link, or it's null either way it's invalid
//soft failing
return false;
}
url = QUrl(rawUrl, QUrl::TolerantMode);
if (!url.isValid()) {
throw JSONValidationError(QString("Invalid URL: %1").arg(rawUrl));
}
resolved = true;
return true;
}