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:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user